locked
Use EMail From Hosted Site RRS feed

  • Question

  • User-1641868886 posted

    I have deployed ASP.Net Authentication with email confirmation for registration on my MVC site, hosted at GoDaddy. I am still trying to learn about the email functionality, especially where hosting vendors are concerned. To illuminate my problem, I have placed all mail settings as config elements so my "SendMail" action can be easily modified, without having to re-publish to make minor changes in a controller action or other c#:

            <mailSettings>
                <smtp>  
                    <network host="smtp.zoho.com" port="465" enableSsl="true" userName="admin@docscost.com" password="*******"/>
                </smtp>    
            </mailSettings>

    ...this gives me a timeout error, "the connected party did not properly respond after a period of time...". So far, all I can glean from reading various threads online is that the host server prevents secure connection with external mail servers. Correct or not?

    <mailSettings>
                <smtp>  
                    <network host="relay-hosting.secureserver.net" port="25" userName="admin@docscost.com" password="*******"/>
                </smtp>    
            </mailSettings>

    ...this setting uses the host's own server, and with my MX records in place to proxy my mail vendor (zoho), the emails do implement and are delivered (testing with my own gmail acct) but with HEAVY Spam warnings on the message and the "Confirm" link contained in the email, port 25 being the [unsecured] culprit. Obviously that's NOT the result I'm looking for where users "Register" and expect an email to confirm registration.

    zoho tech (very helpful) is at a loss on why they are not accessible by the first settings above. They have also concluded it must be on the host end. As for GoDaddy, I'm not able to get clarification as to whether this is an issue of a) not allowing the outside mail vendor to be configured, b) an alternate coding to solve the issue, or c) I have to use INTERNAL mail they provide, but that it would solve the issue. I'd be glad to go the (c) route if I knew it would work.

    If anyone has had a similar experience, or has any knowledge base, or can point me to documentation to clarify this, please advise. Thanks much for looking.

    RC

    Tuesday, May 19, 2020 2:45 PM

All replies

  • User303363814 posted

    I feel your pain.  I have said bad words out loud when wrestling with shared hosting email.

    It might seem counter-intuitive but have you tried using the zoho host  without enableSsl="true"

    I am using GoDaddy shared hosting and sending email successfully.  I don't have another party in the middle, however, so not exactly the same as your case.  I am not putting config in web.config but I doubt that makes any difference.  My code looks like

    client = new SmtpClient("relay-hosting.secureserver.net", 25)
    {
       Credentials = new NetworkCredential("myUsername@mydomain.com", "Mypasswor");
       // EnableSsl = true
    };

    Notice how I have commented out the EnableSsl = true piece?  I used to have it in there and it didn't work.  Removed it and it did work.  The documentation describing EnableSsl is way beyond my comprehension level but I don't think anything bad is happening. (At least emails are not delivered with warnings).

    The MSDN documentation has a large box telling you that EnableSsl = true will throw an SmtpException if the server does not advertise STARTTLS, whatever that is.  Another thing I have seen is that EnableSsl only seems to be used for gmail

    Also, I am using Port 25, maybe experiment with that when you remove the EnableSssl

    Give it a shot and good luck.

    Wednesday, May 20, 2020 12:16 AM
  • User-1641868886 posted

    Thanks, Paul. Yes, I tried commenting out the "enableSsl = true" and either way, I get a timeout error when I try to connect to zoho smtp server. Working with host (GoDaddy) rt now to try to resolve. Will let you know if I learn anything useful.

    Thx

    RC

    Wednesday, May 27, 2020 9:00 PM