从smtpclient .NET发送时,雅虎禁用链接

编程入门 行业动态 更新时间:2024-10-26 09:19:00
本文介绍了从smtpclient .NET发送时,雅虎禁用链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我建立一个Web应用程序发送电子邮件抛出 SmtpClient 在.NET中的应用程序工作正常,成功发送到Gmail账户和Hotmail帐户的电子邮件,但是当我发送邮件到雅虎帐户它成功交付,但我把邮件中的链接是由雅虎禁用。雅虎在某种程度上改写的联系,完全删除的href属性,我不知道该怎么办,我已经想尽格式,我知道,但它是没有好处的。 这里是我用来发送邮件的code。

I'm building a web application that sends emails throw SmtpClient in the application is working fine, emails sent successfully to gmail accounts and hotmail accounts, however when I sent emails to yahoo account it delivered successfully, but the links I put in the message is disabled by yahoo. yahoo somehow rewrites the links and totally remove the "href" property, I dunno what to do, I've tried every format i know but it was no good. here is the code that I use to send messages.

objEmail = new System.Net.Mail.MailMessage(); objEmail.To.Add(new MailAddress(contact.Value.ToString(),null)); objEmail.From = new MailAddress(from, null); objEmail.Subject = subject; objEmail.Body = Body; objEmail.IsBodyHtml = true; SmtpClient client = new SmtpClient(); client.Send(objEmail);

和这里是在web.config文件中的smtpclient定义

and here is the definition of the smtpclient in the web.config file

<system> <mailSettings> <smtp deliveryMethod="Network"> <network enableSsl="true" host="smtp.gmail" password="password" userName="user@gmail" port="587"/> </smtp> </mailSettings> </system>

在邮件正文中,我把这样一个简单的链接,

in the message body I put a simple link like that,

<a href="www.postagi/HomePage.aspx?id=101">tester</a>

这里是雅虎展现在那里的电子邮件收件箱。

here is what yahoo show in there email inbox.

<a id="yui_3_2_0_1_1327400481004292" rel="nofollow">tester</a>

这个错误真的要把我逼疯了,请大家帮忙。

this error really drives me crazy, please help.

推荐答案

我只是解决了它...看来,我必须写的完整链接'的http://我不知道为什么只有雅虎需要这个格式。这是工作的罚款与Gmail和Hotmail,但最后我很高兴,我能解决这个问题。

I just solved it... it seems that i must write the complete link with the '' I dunno why only yahoo needs this format. it was working fine with gmail and hotmail, but in the end I'm glad that I was able to solve it

更多推荐

从smtpclient .NET发送时,雅虎禁用链接

本文发布于:2023-08-07 10:24:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1318605.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:雅虎   链接   smtpclient   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!