-
Sep 24th, 2009, 09:37 AM
#1
Thread Starter
Don't Panic!
[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
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Sep 24th, 2009, 05:05 PM
#2
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.From = "me@my.com" 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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Sep 25th, 2009, 03:07 AM
#3
Thread Starter
Don't Panic!
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...
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Sep 25th, 2009, 03:18 AM
#4
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Sep 25th, 2009, 03:19 AM
#5
Thread Starter
Don't Panic!
Re: [Excel/Access VBA] How to send email.... With a difference
No problem - got those restrictions at the moment too
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|