Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

sending thunderbird mail using access vba

  • 1 reply
  • 1 has this problem
  • 495 views
  • Last reply by bruce13

more options

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

Chosen solution

Have you tried using

DoCmd.SendObject ,,,"EmailAddress","CC","BC","Subject","Msg"

All these required objects can be a string variable.

Read this answer in context 👍 0

All Replies (1)

more options

Chosen Solution

Have you tried using

DoCmd.SendObject ,,,"EmailAddress","CC","BC","Subject","Msg"

All these required objects can be a string variable.