Hi!
If you check Tools, References when you're in the code window, do you
actually have Microsoft CDO listed? Are you running Windows 2000?
Otherwise, I'm not dimming the configuration as a CDO.Configuration but as
an Object and then creating it later (so called late binding), and that works
_without_ having to set the References. This is a snippet from the code I'm
using (with various other parts gleaned from various suggestions that could
be helpful):
Public Sub SendMail(ByVal SendTo As String, ByVal Subject As String, ByVal
MessageText As String, Optional ByVal Attachment As String)
Dim Config As Object, Message As Object
Dim CDOSchema As String
CDOSchema = "
http://schemas.microsoft.com/cdo/configuration/"
Set Message = CreateObject("CDO.Message")
Set Config = CreateObject("CDO.Configuration")
Config.Load -1
With Config.Fields
.Item(CDOSchema & "sendusing") = 2
.Item(CDOSchema & "smtpserver") = < your mail server name here >
'Only used if SMTP server requires Authentication
'.Item(strSch & "smtpauthenticate") = 1
'.Item(strSch & "sendusername") = "(e-mail address removed)"
'.Item(strSch & "sendpassword") = "APassword"
.Update
End With
With Message
Set .configuration = Config
.configuration.Load 1
.From = < sender alias, does not have to be a real mail address >
'.Sender = "(e-mail address removed)" 'Must be a real address I believe
.To = SendTo
.Subject = Subject
.TextBody = MessageText
'.HTMLBody = "Test <B>HTML</B> format!"
If Attachment <> "" Then .AddAttachment Attachment
.Send
End With
End Sub
I don't quite understand the Hotmail mention, if you want to send to a
Hotmail address you just mail it like above, stating your SMTP mail server,
which will then forward it to Hotmail.
Brgds
Danny