Sending e-mails through Access

G

Guest

Hi all,

I'm using the below command to send an e-mail with a report attached to a
certain direction,but actually when i look at the sent items of the Outlook,I
find the e-mail messages in the sent items list but in fron of the sender
e-mail field "To" i there's no e-mail address indicated,although when i click
on the button,i can see the e-mail message with the attachment with the
e-mail addressa lready in the "to" field of the message,now i'm not sure that
the message is already sent to the recepient,can anybody help.
Here's the code:
If [Type] = 1 Then DoCmd.SendObject acReport, "Escalation to
PACTHELP", "RichTextFormat(*.rtf)", "(e-mail address removed)", "", "", [Customer
Name] & "-" & (Left([Language], 2) & "-" &
Code:
), (" " & Chr$(10) & " " &
"Dear team" & " " & Chr$(10) & " " & " " & Chr$(10) & " " & "Kindly find
attached a new escalation" & " " & Chr$(10) & " " & " " & Chr$(10) & " " & "
" & Chr$(10) & " " & " " & Chr$(10) & " " & "Best Reagrds"), True, ""
 
G

Guest

Reviewing the help for the SendObject method we can see that the basic
synthax is

SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject,
MessageText, EditMessage, TemplateFile)

Therefore, we can identify that the 4th input variable will be the To
recipient. Based on your code

DoCmd.SendObject acReport, "Escalation to
PACTHELP", "RichTextFormat(*.rtf)", "(e-mail address removed)", "", "", [Customer
Name] & "-" & (Left([Language], 2) & "-" &
Code:
), (" " & Chr$(10) & " " &
"Dear team" & " " & Chr$(10) & " " & " " & Chr$(10) & " " & "Kindly find
attached a new escalation" & " " & Chr$(10) & " " & " " & Chr$(10) & " " & "
" & Chr$(10) & " " & " " & Chr$(10) & " " & "Best Reagrds"), True, ""[/QUOTE]

Var1-acReport
Var2-"Escalation to PACTHELP"
Var3-"RichTextFormat(*.rtf)"
Var4-"[email protected]"

Unless you are receiving errors when you use the code, it should work.  Why
not replace the To email address with someone's that you can validate works
(to test out your code) and the put back the proper email address once you
know it works as intended.
--
Hope this helps,

Daniel P







[QUOTE="Pietro"]
Hi all,

I'm using the below command to send an e-mail with a report attached to a
certain direction,but actually when i look at the sent items of the Outlook,I
find the e-mail messages in the sent items list but in fron of the sender
e-mail field "To" i there's no e-mail address indicated,although when i click
on the button,i can see the e-mail message with the attachment with the
e-mail addressa lready in the "to" field of the message,now i'm not sure that
the message is already sent to the recepient,can anybody help.
Here's the code:
If [Type] = 1 Then DoCmd.SendObject acReport, "Escalation to
PACTHELP", "RichTextFormat(*.rtf)", "[email protected]", "", "", [Customer
Name] & "-" & (Left([Language], 2) & "-" & [Code]), (" " & Chr$(10) & " " &
"Dear team" & " " & Chr$(10) & " " & " " & Chr$(10) & " " & "Kindly find
attached a new escalation" & " " & Chr$(10) & " " & " " & Chr$(10) & " " & "
" & Chr$(10) & " " & " " & Chr$(10) & " " & "Best Reagrds"), True, ""[/QUOTE]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top