asp.net - Webmail method email sender Name should be displayed -
webmail.send(to: "someone@somewhere.com", subject: "email subject", body: "message body, isbodyhtml: false ); webmail.smtpserver = "smtp.gmail.com"; webmail.smtpport = 587; webmail.enablessl = true; webmail.username = "me@mydomain.com"; webmail.password = "the password"; webmail.from = "me@mydomain.com";
by using above method, receiving email sender name "me@mydomain.com".. tried changing parameters "username" , "from", gmail server rejects message.
what parameter add together receive email sender name instead of email id..
try this:
system.web.mail not total .net native implementation of smtp protocol. instead, uses pre-existing com functionality in cdonts. system.net.mail, in contrast, managed implementation of smtp client.
so in mailaddress = new mailaddress(fromname, fromname);
^
from = gets or sets e-mail address of sender
source
asp.net email razor
No comments:
Post a Comment