Send email To: as alias

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

How do you fill in the "To" portion of a new mailmessage in ASP.NET so that
it appears like "Joe Smith - ACME", versus (e-mail address removed)?

Thanks!
 
hello Vb Programmer ...
i have faced this issue before and i found the solution to it as follows..
there is a liberary called easy mail liberary it is availbel online you can
dwon load it and add its dlls as refrence in the project after that you can
use the smtp in it which provide you a property called (MailToName) and
(MailFromName) and with this liberary there is a help that can guide you how
to use its functions and properties ...
finally i hope that i answered your question (fullfilled your need)
 
There's no need for any additional library. Just format the e-mail address
correctly. The same can be done with the From line.

The correct format is:
"name" <address> which equates to "Joe Smith - ACME" <[email protected]>

[C# Example]
string rcptName = "Joe Smith - ACME";
string rcptEMail = "(e-mail address removed)";

MailMessage mm = new MailMessage();
mm.To = String.Format("\"{0}\" <{1}>", rcptName, rcptEMail);

HTH
 
Great thanks yall!

Dave Fancher said:
There's no need for any additional library. Just format the e-mail
address correctly. The same can be done with the From line.

The correct format is:
"name" <address> which equates to "Joe Smith - ACME" <[email protected]>

[C# Example]
string rcptName = "Joe Smith - ACME";
string rcptEMail = "(e-mail address removed)";

MailMessage mm = new MailMessage();
mm.To = String.Format("\"{0}\" <{1}>", rcptName, rcptEMail);

HTH
----------------
Dave Fancher
http://davefancher.blogspot.com

Mohamed Ahmed said:
hello Vb Programmer ...
i have faced this issue before and i found the solution to it as
follows..
there is a liberary called easy mail liberary it is availbel online you
can
dwon load it and add its dlls as refrence in the project after that you
can
use the smtp in it which provide you a property called (MailToName) and
(MailFromName) and with this liberary there is a help that can guide you
how
to use its functions and properties ...
finally i hope that i answered your question (fullfilled your need)
 
Back
Top