Show friendly display name in the "FROM" and "TO" fields using CDOSYS

I was trying to find an example that would display a “Friendly name” vs. an “email address” when generating emails using CDOSYS.   Here is the code to do this.


             Set imsg = Createobject(“cdo.message”)

With iMsg


   .To = “John Monday <[email protected]>”


   .From = “Steve Friday <[email protected]>”


   .Subject = “A Subject Line: ” & Now()


   .TextBody = “A Text body message”


.Send


End With


Set imsg = nothing


Other links I found


 


 


 

Sample Chapter 1.21 CDO library
http://www.cdolive.com/procdo.htm

 

Sample code
http://www.microsoft.com/mspress/books/sampchap/3449.asp