Des wrote:
On Apr 24, 7:46 am, "Ed Robichaud" <edrobich...@wdn.comwrote:
>>Look in Access Help for the "SendObject" command.
"Des" <despairing...@aol.comwrote in message
news:11*********************@o40g2000prh.googleg roups.com...
>>>I was wondering if anyone could help me out with this. I use Access
2003 to generate certain files and then I convert them to pdf, I was
wondering if anyone would know the code I could use where I would have
the ability to have them automatically emailed after they're converted
to different sources?
>>>I can be emailed via despairing...@aol.com
>>>Thanks..
That doesn't really help me. I use access to bring data in and then I
convert it to pdf and from there is where I would like to set up the
auto email function. I'm assuming it's just a simple batch function
and possibly a script. If anyone has done something like this before,
please let me know. Thanks again for the help.
There are many options. One I prefer is to use the CDO library which can easily be used in
Access VBA or vbScript.
Here is sample code (in vbScript):
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Sample CDO Message"
objMessage.From = """Me"" <me@my.com>"
objMessage.To = "so******@yahoo.com"
objMessage.TextBody = "This is some sample message text.." & vbCRLF & _
"It was sent using the CDO Library."
' ==This section provides the configuration information for the remote SMTP server.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
' Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.your.com"
' Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoNTLM
' Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "youruserid"
' Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword"
' Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
' Connection Timeout in seconds (the maximum time CDO will try to
' establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMessage.Configuration.Fields.Update
' ==End remote SMTP server configuration section==
objMessage.Send
Set objMessage = Nothing
--
---------------
John Mishefske, Microsoft Access MVP