Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Mear ynfo

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

sending thunderbird mail using access vba

  • 1 antwurd
  • 1 hat dit probleem
  • 241 werjeftes
  • Lêste antwurd fan 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

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 = "<b>Please find Your Grave Enquiry as requested.</b><br><br>Bleak House Family History is a group funded purely by donations,<br><br> a donation for this service may be made by <b>Cheque, Payable to Bleak House Family History</b><br><br>Sent to <b>Bleak House Family History, C/o Elmwood Lodge, Timothy Lane, Carlinghow, Batley, Yorkshire, WF17 0AU</b><br><br>or<br><br> by <b>Bank Transfer using the Sort Code of 77 14 15 and Account Number of 25439568.</b><br><br>Please Confirm Receipt of this Email by Return.<br><br> Regards gravesearches@BleakHouseFamilyHistory<br><br><b>====================</b>" 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 👍 0

Alle antwurden (1)

more options

Keazen oplossing

Have you tried using

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

All these required objects can be a string variable.