Here's my version of pretty much the same
Set objMessage = CreateObject("CDO.Message"
)
objMessage.Subject = "A subject"
objMessage.From = "
[email protected]"
objMessage.To = "
[email protected]"
objMessage.TextBody = "Hi someone else."
objMessage.AddAttachment "c:\test.txt"
'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.F
ields.Item
_
("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.F
ields.Item
_
("
http://schemas.microsoft.com/cdo/configuration/smtpserver") = "192.168.10.1"
'Server port (typically 25)
objMessage.Configuration.F
ields.Item
_
("
http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.F
ields.Upda
te
'==End remote SMTP server configuration section==
objMessage.Send