once user register, I want to send verification email. My coding locally it works on localhost. but once i upload on godaddy, it doesn't work
Here is my code
dynamic MailMessage = new MailMessage(); MailMessage.From = new MailAddress(FromAddress); MailMessage.To.Add(message.Destination); MailMessage.Subject = message.Subject; MailMessage.IsBodyHtml = true; MailMessage.Body = message.Body; SmtpClient SmtpClient = new SmtpClient(); SmtpClient.Host = strSmtpClient; SmtpClient.EnableSsl = bEnableSSL; SmtpClient.Port = Int32.Parse(SMTPPort); SmtpClient.Credentials = new System.Net.NetworkCredential(UserID, Password); try { try { SmtpClient.Send(MailMessage); } catch (Exception ex) { } } catch (SmtpFailedRecipientsException ex) { for (int i = 0; i <= ex.InnerExceptions.Length; i++) { SmtpStatusCode status = ex.StatusCode; if ((status == SmtpStatusCode.MailboxBusy) | (status == SmtpStatusCode.MailboxUnavailable)) { System.Threading.Thread.Sleep(5000); SmtpClient.Send(MailMessage); } } }
web.config
<add key="FromAddress" value ="myemail@domain.com"/> <add key="SmtpClient" value="relay-hosting.secureserver.net"/> //on godaddy host <!--<add key="SmtpClient" value="outlook.office365.com"/>--> //for localhost <add key="UserID" value ="myemail@domain.com"/> <add key="Password" value ="PA****WORD"/> <add key ="SMTPPort" value="587"/> //I tried also 25 <add key ="EnableSSL" value="true"/> <add key="RedirectTo" value="thank-you.html"/>
Solved! Go to Solution.
Assalam u Alaikum! Peace
I hope you are well. I think there is misconfiguration in email settings. With Plesk, you can configure your server to use external mail servers, such as Google and Yahoo!, to handle email services.
To Configure Plesk to Support an External Email Server
Note: Once complete, your server sends email from your website, and other applications installed on it, but no longer receives email for the domain name you have disabled email on.
Warning: When you disable email for a subscription in Plesk, it affects all of the domains in that subscription. If you want to allow email on one domain and disable it for another, they need to be in different subscriptions.
Assalam u Alaikum! Peace
I hope you are well. I think there is misconfiguration in email settings. With Plesk, you can configure your server to use external mail servers, such as Google and Yahoo!, to handle email services.
To Configure Plesk to Support an External Email Server
Note: Once complete, your server sends email from your website, and other applications installed on it, but no longer receives email for the domain name you have disabled email on.
Warning: When you disable email for a subscription in Plesk, it affects all of the domains in that subscription. If you want to allow email on one domain and disable it for another, they need to be in different subscriptions.
Good Afternoon @Zulfiqar,
I'm having similar issues, and have tried your posted resolution but Plesk no longer allows us to access via RDP. Any workarounds?