[Solved] Send mail from VBA (1 Viewer)

vba_php

Forum Troll
Local time
Today, 05:46
Joined
Oct 6, 2019
Messages
2,884
you might actually see .Sender rather than .From (and might actually see both properties depending on which package you are using).
that is right, actually! I remember that.
But if, for example, i put "no-reply@google.com" will it work if i don't have such account created there?
more than likely it will, because languages don't care what you put in that spec, as far as I know. If you put that kind of thing in the "reply-to" section of a header, i would seriously doubt that any email server on the planet would spam it out for 2 reasons:
  1. gmail's servers are extremely reliable and recognized by most other servers as being legitimate.
  2. I don't believe servers even care what string is in the "reply-to" section of a header.
you'll have to look it up to be sure though! =)
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:46
Joined
Feb 28, 2001
Messages
27,001
I'm going to back up Adam on this one. I would bet that there IS no account named "no-reply@google.com" because I've had a message get into a ping-pong match once based on a no-reply account. Had to do with my Outlook auto-reply rules for which the subject line set off the rule before it got to the "sender" rule. Had to change the order of the rules to prevent it from continuing the ping-pong match.

The match was caused by the incoming message triggering the auto-reply, which sent the message to no-reply@google.com, which returned it with "no such account" - but the topic triggered the auto-reply, which.... you get the message. I got the message, too. Which is why now when I have any kind of rules, I put the "sender" rules first to filter out stuff that wouldn't work anyway.

Therefore: "will it work if i don't have such account created there?" Probably yes.
 

vba_php

Forum Troll
Local time
Today, 05:46
Joined
Oct 6, 2019
Messages
2,884
disgracept,

it is also noteworthy to say that literally thousands of messages are sent to email servers on the internet all day long, everyday, from global enterprises that have a lot of these strings in the header:

=> no-reply@
=> donotreply@
=> noreply@
=> string-noreply@

so you shouldn't have a problem. But if I were you, I would change the @google.com to something more meaningful, just in case your recipient gets confused. Why would they be getting an email from google if they put in a reset-password request on their network associated with your business, right? =)
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 10:46
Joined
Jul 9, 2003
Messages
16,245
I looked into sending Gmail from MS Access a few years ago and blogged about it on my website Gmail from MS Access, VBA, Excel, Word… I do realise that Google move their goal posts from time to time, but I think it still works. The example shows the use of CDO Let me know if you want a copy of the sample file and I will tell you how you can get a free copy...
 

disgracept

New member
Local time
Today, 10:46
Joined
Jan 27, 2020
Messages
21
disgracept,

it is also noteworthy to say that literally thousands of messages are sent to email servers on the internet all day long, everyday, from global enterprises that have a lot of these strings in the header:

=> no-reply@
=> donotreply@
=> noreply@
=> string-noreply@

so you shouldn't have a problem. But if I were you, I would change the @google.com to something more meaningful, just in case your recipient gets confused. Why would they be getting an email from google if they put in a reset-password request on their network associated with your business, right? =)

vba_php,

Sorry if only now i'm answering, but had a pretty busy day here at work.
It doesn't work if i put the no-reply@gmail.com in the ReplyTo or From properties. It tries to send but always recieve an error message from google server saying that the account doesn't exist.

Of course that, in the end, i'll try to have an internal no-reply address. That is, if the guys at IT department agree on that...
 

disgracept

New member
Local time
Today, 10:46
Joined
Jan 27, 2020
Messages
21
I looked into sending Gmail from MS Access a few years ago and blogged about it on my website Gmail from MS Access, VBA, Excel, Word… I do realise that Google move their goal posts from time to time, but I think it still works. The example shows the use of CDO Let me know if you want a copy of the sample file and I will tell you how you can get a free copy...

Thanks Uncle Gizmo. I appreciate the offer and, if you can, i would like to have that copy, yes!
 

vba_php

Forum Troll
Local time
Today, 05:46
Joined
Oct 6, 2019
Messages
2,884
Try noreply@ems.tescobank.com for testing. I get emails from that address asking foir read receipts. :D
most receiving clients have options that can be set that result in the blockage of the sending party getting read receipts. I learned that by sending out emails from outlook.
It doesn't work if i put the no-reply@gmail.com in the ReplyTo or From properties. It tries to send but always recieve an error message from google server saying that the account doesn't exist.
of course it doesn't work! Hopefully I'm not getting confused here, but did you ever say in this thread that you are using gmail's servers to send out? wait, I guess you already answered that in my quote....well regardless, that makes good sense, because like i said before, google's email servers are just about the best you can get in terms of recognizing errors, IMO. Per Gasman, why can't you use this?
Code:
.Sender = "no-reply@yourDomain.com"
or this?:
Code:
.Sender = "IT-dept@yourDomain.com"
 

disgracept

New member
Local time
Today, 10:46
Joined
Jan 27, 2020
Messages
21
Thanks to all that helped me...
This thread is now Solved...
 

Users who are viewing this thread

Top Bottom