[Excel/Access VBA] How to send email.... With a difference
Hiya,
I am used to sending emails via Outlook. Outlook express refuses, but since that is not an internal problem... ;)
However, rumours have been going around that the main core email is being shifted from MS Outlook and exchange to Google Apps. Presumably the gmail is included in that.
Brilliant, in that I could log in from around the world and send an email/deal with questions.
Then the secondary thought hit home. What happens to all the VBA Excel and Access coding that sends emails?
With no outlook (at least likely to be none) how would it tell gmal / google apps to send an email?
I was wondering if anyone has done this or has links online to information on how to do this.
Main problems are:
I don't know when the transfer is going to be and
I dont have it installed (assuming an installation of some sort is required) yet.
Any pointers appreciated :)
Re: [Excel/Access VBA] How to send email.... With a difference
i have successfully sent email via gmail, using cdo.message,
vb Code:
Set objmessage = CreateObject("CDO.Message")
objmessage.Subject = "Example CDO Message"
objmessage.To = "me" ' sent to myself, not at gmail
objmessage.TextBody = "This is some sample message text."
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'Your UserID on the SMTP server
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "usernm"
'Your password on the SMTP server
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pass"
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
'Server port (typically 25)
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
'Use SSL for the connection (False or True)
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
'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") = 30
objmessage.Configuration.Fields.Update
objmessage.Send
Set objmessage = Nothing
gmail will not allow spoofing of sender name
Re: [Excel/Access VBA] How to send email.... With a difference
thanks :)
Will try if it comes in.
Alternative is that the Outlook will need to be configured to talk to the Google apps and if this is the case, I wont / shouldnt need to change much if anything...
Re: [Excel/Access VBA] How to send email.... With a difference
i believe there is restrictions on the type of attachments that can be sent by gmail
no exes and someothers
Re: [Excel/Access VBA] How to send email.... With a difference
No problem - got those restrictions at the moment too ;)