I am sending emails (with pdf attachments) from my Access 2010 database using Mozilla Thunderbird. However I have several accounts in Thunderbird. Is there a way to have Access choose the account to use for sending? I've searched Thunderbird to see if there is a way to choose the default account for sending, but no luck, so I'm hoping I can do it from Access. Here's the code I'm using at present:
Thanks,
Leathem
Code:
Private Sub Command20_Click()
' Error handler
On Error GoTo 0
' Create a SELECT command
Dim StudentQuery
StudentQuery = "SELECT [StudentDataQuery].StudentName, [StudentDataQuery].[E-MAIL] FROM [StudentDataQuery]"
' Get a recordset using the query
Dim Recordset
Set Recordset = CurrentDb.OpenRecordset(StudentQuery)
' Move through the recordset looking at each record
Do Until Recordset.EOF
Dim StudentName, EmailAddress
StudentName = Recordset("StudentName")
EmailAddress = Recordset("E-MAIL")
Forms.DistributeLetters.StudentName = StudentName
Forms.DistributeLetters.EmailAddress = EmailAddress
If EmailAddress = "" Or IsNull(EmailAddress) Then
Forms.DistributeLetters.EmailAddress = "No Email"
Else
DoCmd.SendObject acReport, "Enrolled Students Letter", "PDFFormat(*.pdf)", _
EmailAddress, "", "", "CLS Course Enrollment confirmation", "Attached please find your confirmation letter. It is in Adobe pdf format.", False, ""
End If
Recordset.MoveNext
Loop
End Sub
Leathem