Automatically Send E-mail w/An Attachment

zyousafi

Registered User.
Local time
Today, 07:58
Joined
Jun 13, 2010
Messages
39
I want to be able to send an e-mail automatically with an attachment with the press of a button. When the user presses the button, the application would search the e-mail address in the system based the name of the agent who was being evaluated, attach the report in PDF format, and then send the e-mail without the user having to open Microsoft Outlook himself/herself.

I have been able to get the button to open Microsoft Outlook with the attachment in PDF format; however the e-mail is not populating based on the agent who was being evaluated and the e-mail will not send itself. The user right now has to open Microsoft Outlook and send the e-mail himself/herself.

Can someone please help me?
 
I want to be able to send an e-mail automatically with an attachment with the press of a button. When the user presses the button, the application would search the e-mail address in the system based the name of the agent who was being evaluated, attach the report in PDF format, and then send the e-mail without the user having to open Microsoft Outlook himself/herself.

I have been able to get the button to open Microsoft Outlook with the attachment in PDF format; however the e-mail is not populating based on the agent who was being evaluated and the e-mail will not send itself. The user right now has to open Microsoft Outlook and send the e-mail himself/herself.

Can someone please help me?

Without seeing your database or at least the VBA code, it is very difficult to spot the issue.

Would you please post the VBA code you are using?
 
The code being used right now is as follows:
Private Sub SendFeedbackForm_Click()
On Error GoTo Err_SendFeedbackForm_Click
Dim stDocName As String
stDocName = "Feedback Form (Report)"
DoCmd.SendObject acSendReport, stDocName, acFormatPDF

Exit_SendFeedbackForm_Click:
Exit Sub
Err_SendFeedbackForm_Click:
MsgBox Err.Description
Resume Exit_SendFeedbackForm_Click

End Sub
This code manages to open Microsoft Outlook and manages to attach the report I want sent. The e-mail address of the agent being evaluated is located in a table called "CROs". I want to, based on the name of the agent being evaluated, automatically call his/her e-mail address and automatically send him/her the report.
 
Search the forum for "email outlook" for code to create an email to populate all the parts of the email. You can use a Dlookup() to find the correct email address for the To: section. I suggest you look at the code I posted in this thread Outlook 2007 & E-mails

Bonus, since you are using Access 2007 or 2010 you will not get the nag email warning from outlook about sending an email when you use outlook automation code to create and send the email.
 
Thank you very much for your reply; however I really did not understand your reply. I have attached the file that I have been working on. Can you please help me with this attached file?
 

Attachments

Users who are viewing this thread

Back
Top Bottom