michellecole
Programmer
I am sending a report from a form in Access via email to a distribution list that will be built each time the report is run based on the data of the report - the distribution list can exceed over 100 email addresses. I am using MS Outlook 9.0 from MS Access 2000.
My first question is: Is there a specific email address format required? i.e. "Michelle.cole@businessname.com" vs. "Cole, Michelle". If the address is formatted as "michelle.cole@businessname.com; mcole@businessname.com; etc.", all is good. But if the address is formatted as "Cole, Michelle; Gray, Sabrina", I receive the following MS error msg, "Unknown Message Recipient(s); Message was not sent." If I go directly to Outlook, open a new mail message and plug in "Cole, Michelle; Gray, Sabrina" the message will send with no issue.
Here is my code:
*
*
Dim strTo 'The "To" recipients of the email message, separated by semicolon (
Dim strSubject 'The "Subject" line of the email message
Dim strText 'The "Text" of the email message
'Build the "To" distribution List...
'strTo = "Michelle.Cole@test1.com; mcole2@test2.com" 'this format works!
strTo = "Cole, Michelle; Gray, Sabrina"
strSubject = "Subject Line Info"
strText = "Body of Email"
DoCmd.SendObject acReport, stDocName, "SnapshotFormat(*.snp)", strTo, "", "", strSubject, strText, False, ""
*
*
(I am using .snp because the report has lines, shading, etc. and this format holds these elements.) I don't want to plug in "True" and allow the user to Edit the Message in production, but when I did it temporarily to see what was being plugged into the recipient line of the email when I was using "Cole, Michelle; Gray, Sabrina" - "Cole; Michelle; Gray; Sabrina" was what populated in the Recipient line (notice that the commas were converted to semicolons) causing the error.
Question #2: Is there a limit as to how many email addresses (or charachters) I can place in the variable "strTo"?
Thank you,
Michelle
My first question is: Is there a specific email address format required? i.e. "Michelle.cole@businessname.com" vs. "Cole, Michelle". If the address is formatted as "michelle.cole@businessname.com; mcole@businessname.com; etc.", all is good. But if the address is formatted as "Cole, Michelle; Gray, Sabrina", I receive the following MS error msg, "Unknown Message Recipient(s); Message was not sent." If I go directly to Outlook, open a new mail message and plug in "Cole, Michelle; Gray, Sabrina" the message will send with no issue.
Here is my code:
*
*
Dim strTo 'The "To" recipients of the email message, separated by semicolon (
Dim strSubject 'The "Subject" line of the email message
Dim strText 'The "Text" of the email message
'Build the "To" distribution List...
'strTo = "Michelle.Cole@test1.com; mcole2@test2.com" 'this format works!
strTo = "Cole, Michelle; Gray, Sabrina"
strSubject = "Subject Line Info"
strText = "Body of Email"
DoCmd.SendObject acReport, stDocName, "SnapshotFormat(*.snp)", strTo, "", "", strSubject, strText, False, ""
*
*
(I am using .snp because the report has lines, shading, etc. and this format holds these elements.) I don't want to plug in "True" and allow the user to Edit the Message in production, but when I did it temporarily to see what was being plugged into the recipient line of the email when I was using "Cole, Michelle; Gray, Sabrina" - "Cole; Michelle; Gray; Sabrina" was what populated in the Recipient line (notice that the commas were converted to semicolons) causing the error.
Question #2: Is there a limit as to how many email addresses (or charachters) I can place in the variable "strTo"?
Thank you,
Michelle