邮件发送失败 [英] Mail sending failure

查看:101
本文介绍了邮件发送失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
这是我尝试发送邮件的代码.由于我有一个半月的时间试图发送邮件,但它给了很多麻烦.很少有人告诉您必须在web.config文件中进行配置.我什么都不知道,但是有些我是如何做出改变的.

Hi everyone,
This is the code where im trying to send mail. Since one n half month im trying to send mail, but its giving very much trobule. Few told have to configure in web.config file. I dint know anything, but some how i made changes.

<system.net>
        <mailSettings>
            <smtp>
                <network host="localhost" port="25"/>
            </smtp>
        </mailSettings>
    </system.net>



告诉我是否有人知道为什么v必须在配置文件中进行更改,

有人告诉必须配置smtp ...,但我不是从本地服务器发送的.我的网站已经托管...

我的网站网址是www.karthavyaebusiness.com

Message.From =新的MailAddress("http://mail.karthavyaebusiness.com");
Message.To.Add(新MailAddress("kr​​iish05@yahoo.com"));
Message.Subject =关于产品的查询";
Message.Body =测试消息";
SmtpClient客户端=新的SmtpClient("127.0.0.1");
client.Send(Message);

请帮助我任何人,我对.net很陌生.
将thnks推进到所有...



Tell me if any one knows why v have to make changes in config file,

Some one told have to configure smtp... but im not sending from local server. My website already hosted...

my website url is www.karthavyaebusiness.com

Message.From = new MailAddress("http://mail.karthavyaebusiness.com");
Message.To.Add(new MailAddress("kriish05@yahoo.com"));
Message.Subject = "Enquiery About Product";
Message.Body = "Testing Message";
SmtpClient client = new SmtpClient("127.0.0.1");
client.Send(Message);

Pls help me any one, Im stranges to .net.
Advance thnks to all...

推荐答案

编译器提示什么错误?


问题出在该行中

The problem is in the line

Message.From = new MailAddress("http://mail.karthavyaebusiness.com");



因为 http://mail.karthavyaebusiness.co m不是有效的电子邮件地址.



as http://mail.karthavyaebusiness.com is not a valid e-mail address.


这篇关于邮件发送失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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