
sending thunderbird mail using access vba
Hi
I am using Thunderbird to send email via access 2007 vba. Everything is ok until I get to the email send.
In the body, the text is duplicated using text that is not in the application. I have copied my code below, I cannot spot anything that is incorrect, any help would be appreciated.
Thanks in anticipation
Attachment1 = Environ("userprofile") & "\desktop\Batley Cemetery Grave Enquiry.pdf" 'Grave Enquiry
Attachment2 = Environ("userprofile") & "\documents\bleak house\batley cemetery\pdfs\BatleyCemeteryFullplan.pdf" 'Full Graveyard Plan 'Attachment3 added in Grave Plans Section Section Plan Attachment4 = Environ("userprofile") & "\documents\datafiles\batley cemetery\pdfs\batleycemeteryinfosheet.pdf"
email = Address
CC = vbNullString bcc = vbNullString
SendFrom = "gravesearches@bleakhousefamilyhistory.co.uk"
Subject = "Your Grave Enquiry for Batley Cemetery for Surname - " + Surname + " - Grave Reference - " + GraveRef
EmailBody = vbNullString
EmailBody = "Please find Your Grave Enquiry as requested.
Bleak House Family History is a group funded purely by donations,
a donation for this service may be made by Cheque, Payable to Bleak House Family History
Sent to Bleak House Family History, C/o Elmwood Lodge, Timothy Lane, Carlinghow, Batley, Yorkshire, WF17 0AU
or
by Bank Transfer using the Sort Code of 77 14 15 and Account Number of 25439568.
Please Confirm Receipt of this Email by Return.
Regards gravesearches@BleakHouseFamilyHistory
===================="
Attachment = Attachment1 + "," + Attachment2 + "," + Attachment3 + "," + Attachment4
Thund = "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe" & _
" -compose " & """" & _ "from='" & SendFrom & "'," & _ "to='" & email & "'," & _ "cc='" & CC & "'," & _ "attachment='" & Attachment & "'," & _ "bcc='" & bcc & "'," & _ "subject='" & Subject & "'," & _ "body='" & EmailBody & "'," & """"
Call Shell(Thund, vbNormalFocus) For counter1 = 1 To 10000 Next 'Application.Wait (Now + TimeValue("0:00:03")) SendKeys "^{ENTER}", True
Keazen oplossing
Have you tried using
DoCmd.SendObject ,,,"EmailAddress","CC","BC","Subject","Msg"
All these required objects can be a string variable.
Dit antwurd yn kontekst lêze 👍 0Alle antwurden (1)
Keazen oplossing
Have you tried using
DoCmd.SendObject ,,,"EmailAddress","CC","BC","Subject","Msg"
All these required objects can be a string variable.