Gmail的SMTP得到错误与GoDaddy [英] Gmail smtp getting error with Godaddy

查看:299
本文介绍了Gmail的SMTP得到错误与GoDaddy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这code工作在离线模式:

This code works in offline mode:

code背后:

SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.UseDefaultCredentials = false;
client.EnableSsl = true;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Credentials = new NetworkCredential("account@gmail.com", "password");

MailMessage message = new MailMessage("account@gmail.com", emailTo);
message.Subject = subject;
message.Body = msg;

client.Send(message);

Web.config文件:

Web.config:

<system.net>
  <mailSettings>
    <smtp from="account@gmail.com">
      <network host="relay-hosting.secureserver.net"/>
    </smtp>
    </mailSettings>
</system.net>

但是,当我在Godaddy的主机放到网上它不工作。我需要做什么?
谢谢!

But when I put online at Godaddy hosting it doesnt work. What do I have to do? Thanks!!

推荐答案

您可以配置你的web.config文件在Godaddy的电子邮件服务提供商发送电子邮件一样.....

You can configure your web.config file to send email on Godaddy email service provider like.....

<system.net> 
      <mailSettings> 
        <smtp from="youemail@yourhost.com"> 
          <network 
            host="relay-hosting.secureserver.net" 
            port="25" 
        /> 
        </smtp> 
      </mailSettings> 
    </system.net>

这是需要使用relay-hosting.secureserver.net作为SMTP邮件服务器,并与25端口(默认),这仅适用。

It is required to use "relay-hosting.secureserver.net" as the smtp mail server, and this only works with port 25 (the default).

这篇关于Gmail的SMTP得到错误与GoDaddy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆