asp.net - set image in email body using html c# -
i know thats not new question want know when set image in email body using below c# code, why image not show on mail
smtpclient client = new smtpclient(); mailmessage mymessage = new mailmessage(); string body = "<img src=\"images/logo2.png\" style=\"width:75px; height:75px;\" />"; mymessage.to.add(new mailaddress(txtemail.text)); mymessage.subject = "subject"; mymessage.body = body; mymessage.isbodyhtml = true; try { client.send(mymessage); } catch (exception ex) { response.write("unable send email" + ex); }
i using asp.net c#.
email opened in email client , doesn't know web-application access image. image src shouldn't relative application. change src include full url:
<img src=\"http://www.somedomain.nl/images/logo2.png\"
test url in browser taking src value , try browsing it. if doesn't work, src value isn't retrievable.
Comments
Post a Comment