从自己的实时网站发送电子邮件中的问题 [英] Problems in Sending Email from own live website

查看:155
本文介绍了从自己的实时网站发送电子邮件中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是瑜伽士.我已经建立了一个网站,使用户可以发送邮件
我的问题是,当我从本地主机上的PC发送邮件时,
一切正常,但是当我在域服务器上上传我的网站时,电子邮件未发送,提示发送邮件失败...
我的代码是....

hi i am yogesh. i have made a website which enable user to send mails
my problem is that when i am sending mail from my pc that is from local host
everything works good but when i UPLOAD my website on my domain server email is not sent its saying failure sending mail...
my code is....

MailMessage mail = new MailMessage();
            SmtpClient smtp = new SmtpClient();
            MailAddress addressFrm = new MailAddress("softdotnet09@gmail.com");
            mail.From = addressFrm;
            mail.To.Add("iamyogeshsharma@yahoo.com");
            mail.IsBodyHtml = true;
            mail.Body = MSG;
            mail.Subject = "Client Order";
            smtp.Host = "smtp.gmail.com";
            smtp.Port = 587;
            smtp.EnableSsl = true;
            smtp.Credentials = new System.Net.NetworkCredential("softdotnet09@gmail.com", "12345");
            smtp.Send(mail);



请帮我从我自己的域名发送电子邮件的必需操作
例如:它是www.example.com
我该怎么办...还要说明...
如何使用我的域名附带的电子邮件帐户而不是gmail帐户...
任何帮助将不胜感激...谢谢..



please help me what i have to do to send email from my own domain name
example: it is www.example.com
what i have to do... Also explain...
how to use email account that comes with my domain name instead of gmail account...
Any Help wiil be appreciated...thanks..

推荐答案

您需要查看ACTUAL错误消息,它将告诉您发送失败的原因.如果您卡住了,请将其张贴在这里.如果您是通过gmail发送的,而不是通过本地邮件服务器发送的,则无需做任何其他事情.
You need to look in to the ACTUAL error message, it will tell you why your send is failing. Post it here if you are stuck. You shouldn''t have to do anything different, if you''re sending through gmail and not through a local mail server.


这可能是由于各种原因造成的.您需要一一看待它们.
港口开放吗?防火墙权限到位了吗?
进一步确保已在Web.Config中配置SMTP配置:
It can be because of various reasons. You need to look at them one by one.
Is the port open? Firewall permissions in place?
Further make sure you have configured SMTP configuration in Web.Config:
<system.net>
   <mailSettings>
     <smtp from="abc@somedomain.com">
       <network host="somesmtpserver" port="25" userName="name" password="pass" defaultCredentials="true" />
     </smtp>
   </mailSettings>
</system.net>


如果需要,请查看此Microsoft Video教程:
使用ASP.NET发送来自网站的电子邮件 [在ASP.NET中发送电子邮件的教程 [


If needed, have a look at this Microsoft Video tutorial:
Use ASP.NET to send Email from Website[^]
Tutorials on sending Email in ASP.NET[^]

BTW, from next time, always share the exact error you get.


这篇关于从自己的实时网站发送电子邮件中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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