create button used to sent an email (1 Viewer)

mimie

Registered User.
Local time
Yesterday, 23:05
Joined
Jul 4, 2012
Messages
10
Hi,
I'm trying to create a button who is able to send a email with an attachment.
The attachment will be all the time the same file.
The email address to sent to is one of the field of the database.
I need a copy sent in my email address as well.
Thanks for your help.
 

Shado

Registered User.
Local time
Today, 16:05
Joined
Jun 5, 2012
Messages
23
If you're using Outlook, this is easily achieved. Don't have the code handy for it at present though.
 

mimie

Registered User.
Local time
Yesterday, 23:05
Joined
Jul 4, 2012
Messages
10
sorry I didnt specified.
I'm using access 2007
 

Addyman

Registered User.
Local time
Yesterday, 23:05
Joined
Dec 29, 2011
Messages
90
What Shado meant was what Email software will you be using to actually send the email?

Do you use Outlook (which makes it easier) or some other email software (whcih might make things more tricky)?

I have plenty of code I use for creating and sending emails via Outlook from Access.
 

mimie

Registered User.
Local time
Yesterday, 23:05
Joined
Jul 4, 2012
Messages
10
Sorry... I didn't inderstand.
I will used Gmail.
 

mimie

Registered User.
Local time
Yesterday, 23:05
Joined
Jul 4, 2012
Messages
10
I have got this so far but I have got a message from Access :"an expression you entered is the wrong data type for one of the arguments."


Private Sub send_form_Click()
On Error GoTo err_send_form_click

Dim stdocname As String
stdocname = "r_mailing"
DoCmd.SendObject acSendNoObject, stdocname, acFormatXLS, Me.ct_email, "ab@gmail.com", , "test", "Hi, Please find attached....", True

exit_send_form_click:
Exit Sub

err_send_form_click:
MsgBox Err.Description
Resume exit_send_form_click

End Sub
 

mimie

Registered User.
Local time
Yesterday, 23:05
Joined
Jul 4, 2012
Messages
10
is anybody can help me out please...
 

Shado

Registered User.
Local time
Today, 16:05
Joined
Jun 5, 2012
Messages
23
Look into sending messages via Outlook. By far the easiest method and it works a treat. If I were at work I could paste you some code. I think it's a similar format to your current code though.
 

mimie

Registered User.
Local time
Yesterday, 23:05
Joined
Jul 4, 2012
Messages
10
The email are going through gmail at work. Everybody will use this database. So I need something easy to use for everybody and something who I dont have to set up in different computer.
Am I understandable ?
 

mimie

Registered User.
Local time
Yesterday, 23:05
Joined
Jul 4, 2012
Messages
10
Is anyone know the code to use Gmail with access ??
 

Users who are viewing this thread

Top Bottom