如何在godaddy主机上使用gmail发送电子邮件 [英] how to send email using gmail on godaddy hosting

查看:97
本文介绍了如何在godaddy主机上使用gmail发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法在godaddy上使用gmail发送电子邮件,但它可以运行o localhost:(

unable to send Email using gmail on godaddy but it works o localhost :(

推荐答案





有很多关于此的文章,但是让我给你一个链接,你可以在那里看到代码中你需要的细微变化,



通过ASP从gmail帐户发送电子邮件。 NET [ ^ ]



同时发布您的代码以确定确切的错误。



谢谢。
Hi,

There are so many articles written on this but let me give you one link from where you can see minor changes that you need in your code,

Email sending from gmail account through ASP.NET [^]

Also post your code to identify exact error.

thanks.


此代码工作。我从许多网站搜索但无法从任何网站找到解决方案,但这段代码真正起作用得到了



http://vandelayweb.com/sending-asp-net-emails-godaddy-gmail-godaddy-hosted/



this Code Works. i have search from many sites but can't find the solution from any site but this code really works got the help from

http://vandelayweb.com/sending-asp-net-emails-godaddy-gmail-godaddy-hosted/

//Create the msg object to be sent

MailMessage msg = new MailMessage();
//Add your email address to the recipients
msg.To.Add("mr@soundout.net");
//Configure the address we are sending the mail from
MailAddress address = new MailAddress("mr@soundout.net");
msg.From = address;
msg.Subject = txtSubject.Text;
msg.Body = txtName.Text + "n" + txtEmail.Text + "n" + txtMessage.Text;

SmtpClient client = new SmtpClient();
client.Host = "relay-hosting.secureserver.net";
client.Port = 25;

//Send the msg
client.Send(msg);


SmtpClient ss = new SmtpClient();
               ss.Host = "relay-hosting.secureserver.net";
                ss.Port = 25;
                ss.Timeout = 10000;
                ss.DeliveryMethod = SmtpDeliveryMethod.Network;
                ss.UseDefaultCredentials = false;
                ss.Credentials = new NetworkCredential("your_full_emailAddress", "YourPassword", "your_Domain");
                ss.EnableSsl = false;
 
                MailMessage mailMsg = new MailMessage("your_full_emailAddress", "demo@gmail.com", "subject here", "my body");
                mailMsg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
                ss.Send(mailMsg);
 
                Response.Write("Mail Sent");


这篇关于如何在godaddy主机上使用gmail发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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