Sending email through gmail SMTP on GoDaddy [close

2019-01-10 21:37发布

Is this possible? I am able to send through localhost, but on godaddy the email doesn't get sent. Has anyone managed to achieve this?

I'm using C#

标签: c# .net smtp
12条回答
再贱就再见
2楼-- · 2019-01-10 22:08

This seems to be a common issue.

There are two things required.

  • Add a user that will be used for authentication. You can't send anonymously via GoDaddy
  • Follow the configuration specified here.

This should make it work correctly.

查看更多
我想做一个坏孩纸
3楼-- · 2019-01-10 22:08

I am trying something similar, just got reset emails and register emails, had to change the $header to noreply@zzz.com to match the website address. Didn't need SMTP, just takes forever to receive the email....still a work in progress.

            $subject = "Please reset your password";
            $message = " Here is your password reset code {$validation_code}

             Click here to reset your password http://www.zzz.com/Login_App/code.php?email=$email&code=$validation_code
            ";

            $headers = "From: noreply@zzz.com";
查看更多
祖国的老花朵
4楼-- · 2019-01-10 22:10

It appears that GoDaddy blocks the SSL ports required by gmail's smtp access. This means you are out of luck at this point. You could just use GoDaddy's local relay:

relay-hosting.secureserver.net with no credentials.

http://help.godaddy.com/article/955

查看更多
ゆ 、 Hurt°
5楼-- · 2019-01-10 22:10

I think your best option is to find another host. When I was coding for a site on godaddy I remember asking godaddy whether they disabled their mapi functions and it turns out they do a little more than just disable it. I've heard they filter specific outgoing ports.

查看更多
Ridiculous、
6楼-- · 2019-01-10 22:12

After experiencing the same issue you are describing in your question, I finally figure out a solution.

Check your web.config file and make sure that the debug property is set to false whenever you publish your website. Let me know if this works. It did for me.

<configuration>
  <system.web>    
    <compilation debug="false" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <customErrors mode="Off"/>
  </system.web>      
</configuration>
查看更多
对你真心纯属浪费
7楼-- · 2019-01-10 22:13

The last time I tried doing this (maybe early 2011-ish) I was not able to programmatically send out from Gmail account on GoDaddy. I took code the exact same code that worked on a different hosting company's server and it failed on GoDaddy's server so I'm quite confident that the code was not the issue.

I called their tech support and got conflicting information but I had heard enough to convince myself sending via Gmail was not a for sure supported service on GoDaddy's servers.

I was also given the workaround option of using their web email form which is totally not what the project I was working on could use and underscored the notion that GoDaddy did not fully understand what they talking about.

In the end I found that I was able to just use GoDaddy's SMTP servers and plug in my own "from" address which allowed me to send mail to any email address and to spoof the origination email address. So they end up locking down legitimate email functionality and instead force you to use a highly abusable system instead.

Again, this was a while ago that I ran into this issue but it would be easy enough to check to see if they still allow you to use their SMTP server to send emails.

查看更多
登录 后发表回答