yahoo disable links when sent from smtpclient .net

孤街醉人 提交于 2019-11-29 23:48:32

问题


I'm building a web application that sends emails throw SmtpClient in .net 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);

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

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

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

<a href="http://www.postagi.com/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.


回答1:


I just solved it... it seems that i must write the complete link with the 'http://' 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




回答2:


Yahoo disabled all images and links in the email, specially when the email goes to the spam folder. There is possible issue with the domain name or the IP you use on sending email that makes your email goes to the spam folder. To solve the issue of disabled images and links is to mark the email as "Not Spam". Email will automatically went to normal inbox with no issue on images and links.



来源:https://stackoverflow.com/questions/8986335/yahoo-disable-links-when-sent-from-smtpclient-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!