(1) GoDaddy SMTP server settings in web.config are as follows. Please note that you do not need username and password information here.
<system.net>
<mailSettings>
<smtp>
<network host="relay-hosting.secureserver.net" port="25" />
</smtp>
</mailSettings>
</system.net>
(2) I used Contact Form in ASP.NET and took FROM email address from textbox, which most people do. The thing is GoDaddy mail system denied this kind of email address.
string from = txtEmail.Text.Trim();
string subject = txtSubject.Text.Trim();
string body = txtMsg.Text;
string to = WebConfigurationManager.AppSettings["MailAccount"];
body = string.Format("From: {0}{1}{2}", from, Environment.NewLine, body);
from = to; // Do not use user's email address
MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient smtp = new SmtpClient();
smtp.Send(message);
So the workaround is to use my domain email account in FROM part and put the customer's email to subject or body part. I don't like it but it worked anyway...
No comments:
Post a Comment