Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Background:
I have a website(asp.net/c#) that is hosted on a server, the website is also still on my local pc.
In my website i have a form that is used to send emails. When on my local pc and using that form to send emails it works 100% but when on the server and using that form i get the error:
Mailbox unavailable. The server response was: Access denied - Invalid HELO name (See RFC2821 4.1.1.1)

The code i use to send the email is as follows
C#
String PasswordOfEmailAddress   = "xxx";
String Host                     = "host.com"; 


String sendFrom = "no-reply@test.co.za";
String sendTo = txtEmailAdress.Text;
String sendSubject = txtSubject.Text;
String body = txtBody.Text;

String sendMessage = body;
            
NetworkCredential emailUserPassw = new NetworkCredential(sendFrom, PasswordOfEmailAddress);
SmtpClient SendingEmail = new SmtpClient(Host);

SendingEmail.EnableSsl = true;
SendingEmail.Credentials = emailUserPassw;
SendingEmail.Send(message);            


First of all, i dont even know what the error means and second i have no idea where to start by fixing it
Someone told me to add UserDefaultCedential = false
That gave me an error of ... Server does not support sercure connections

If Anyone can help i will appreciate it
Posted
Comments
Richard MacCutchan 27-Mar-14 7:31am    
The name "host.com" does not look like a valid SMTP server, are you sure it's correct?
Member 10395722 27-Mar-14 7:50am    
I have just put that one in for question purposes, i have the correct SMTP server in my code
Richard MacCutchan 27-Mar-14 8:58am    
The error is telling you that when your client tried to start a mail session with the SMTP host it sent some invalid information. It is difficult to know what to suggest other than maybe contacting the administrators of the mail host to see if they can find out what is being sent. If you can do some network tracing from your end then you may be able to find the bad information.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900