cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot send email after hosting on plesk Godaddy

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"/>
2 REPLIES 2
Super User II
Super User II

Re: Cannot send email after hosting on plesk Godaddy

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

  1. Log in to your Parallels Plesk Panel as admin. For more information, see Log in to my server.
  2. If necessary, switch to Service Provider view. For more information, see Accessing Service Provider View in Plesk.
  3. Next to the domain name you want to manage, click Domains, and then click Open in Control Panel.
  4. Click the Mail tab, and then click Change Settings.
  5. Deselect Activate mail service on domain.
  6. Click OK.

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.

 

Zulfiqar Anees | GoDaddy Pro | Founder/CEO at FastTech Media, TechMag, and ZulWeb.

Re: Cannot send email after hosting on plesk Godaddy

Good Afternoon @ZulWeb,

 

I'm having similar issues, and have tried your posted resolution but Plesk no longer allows us to access via RDP. Any workarounds?