Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daniel Rogers 134 posts 712 karma points
    Dec 26, 2018 @ 05:17
    Daniel Rogers
    0

    Email settings for gmail

    I have read plenty of threads on this topic all are a few years old and giving me no new insights.

    I have a website using a uskinned skin and trying to get a contact page to work, I have done this a few times now using the godaddy email system as the host. But are not a huge fan so are trying to setup a new client on the gmail business system and a named email domain. The website is hosted on godaddy and I have the email working in outlook with the mx records all setup in godaddy etc.

    My problem is the contacts page on the website dosnt work.

    web.config is configured as

    <mailSettings>
      <smtp from="[email protected]">
        <network host="smtp.gmail.com" port="587" userName="[email protected]" password="v}fbrD>>_jcR" defaultCredentials="false" enableSsl="true" />
      </smtp>
    </mailSettings>
    

    Outlook 2019 sets itself up using port 465.

    If I use port 587 umbraco smtp health check has an issue. But if I use 465 it passes.

    However the contacts page doesnt work either way.

    Gmail is setup for imap, use less secure apps.

    If I swap out all the smtp settings for my own email account (hosted at godaddy) the form works.

    Any surgestions what I may be missing.

  • Daniel Rogers 134 posts 712 karma points
    Dec 27, 2018 @ 13:26
    Daniel Rogers
    0

    Have copied the settings into a project running in visual studio

    <mailSettings>
      <smtp from="[email protected]">
        <network host="smtp.gmail.com" port="465" userName="[email protected]" password="v}fbrD>>_jcR" defaultCredentials="false" />
      </smtp>
    </mailSettings>
    

    By having 465 it keeps the health check happy.

    Inside my contactformcontroller I have inserted the following lines

                smtp.EnableSsl = true;
                smtp.Port = 587;
    

    in between these 2 lines

               System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
               smtp.Send(msg);
    

    in my visual studio the email sends in the live site it dosnt work.

  • Daniel Rogers 134 posts 712 karma points
    Dec 28, 2018 @ 03:41
    Daniel Rogers
    103

    Solved

    Godaddy doesn't allow a third party email on its hosting.

    Solution is to use there relay services.

    remove added lines above from surface controller.

    web.config file needs to be set as

      <smtp from="[email protected]">
        <network host="relay-hosting.secureserver.net" 
         port="25" />
    
      </smtp>
    

    done.

Please Sign in or register to post replies

Write your reply to:

Draft