PDA

View Full Version : cdo sys set from name


esthera
03-10-2008, 05:32 PM
sch = "http://schemas.microsoft.com/cdo/configuration/"

Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "<enter_mail.server_here>"
.update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.From = "from@me.com"
.To = "to@me.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing

how can i set not just the from email and to email but also the fromname and toname?

Spudhead
03-12-2008, 12:27 PM
Umm... this might be a stoopid answer but could you just do:

.From = "My Name<from@me.com>"

?