I can populate an email message but it only lets me manually send.

G

Guest

Hi,

I have the following code that will let me populate an Outlook email box but
it won't send automatically. It pops up on my screen requiring me to hit the
SEND button to send the email. What do I need to do to automate the send
button?

Thanks,

Todd.

If Level = 3 Then
strSubject = "Escalation Level 3 Notification"
strEmailList = "(e-mail address removed); "
strMessage = "A Maintenance Job has reached your Escalation
Level. Please Follow Up With Dispatcher about, "
DoCmd.SendObject acSendNoObject, acFormatRTF,
strEmailList, , , strSubject, strMessage, , False
DoCmd.close
ElseIf Level = 4 Then
strSubject = "Escalation Level 4 Notification"
strEmailList = "(e-mail address removed); "
strMessage = "A Maintenance Job has reached your
Escalation Level. Please Follow Up With Dispatcher about, "

DoCmd.SendObject acSendNoObject, acFormatRTF,
strEmailList, , , strSubject, strMessage, , False
DoCmd.close
End If
 
G

Guest

I realized if I added FALSE to the edit, I get the email to try to send
automatically. However, I now get a popup stating something like "someone is
trying to send and email on your behalf. Click if this is OK. -- YES - No -
Cancel.

DoCmd.SendObject acSendNoObject, acFormatRTF,
strEmailList, , , strSubject, strMessage, FALSE, False

Is there a way not to get this?

Todd.
 
G

Guest

If Level = 3 Then
DoCmd.SendObject acSendNoObject, "", "RichTextFormat(*.rtf)",
"(e-mail address removed) ", "â€, "", " Escalation Level 3 Notification ", " A
Maintenance Job has reached your Escalation
Level. Please Follow Up With Dispatcher about, ", False, ""
End if
ElseIf Level = 4 Then
DoCmd.SendObject acSendNoObject, "", "RichTextFormat(*.rtf)",
"(e-mail address removed) ", "â€, "", " Escalation Level 4 Notification ", " A
Maintenance Job has reached your Escalation
Level. Please Follow Up With Dispatcher about, ", False, ""
End If
End Sub


Note I have not used the "else" as not sure if you have other levels.

Outlook security warning are there to stop you sending out "stuff" without
knowing it. You can use other mail systems (send direct to the mail server,
etc) but I would leave the security warnings in outlook in place - up to you
:)
 
G

Guest

ooops there is an an end if missing off the end - and a space after the
else(if).

sorry
 

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