Kamis, 06 Agustus 2015

[MS_AccessPros] Verify email was sent via MSAccess 2013 to Outlook 2013/Email sent from different account (not default)

 

From the following code will send an email from an Access form to Outlook:


Private Sub cmdEmail_Click()

Me.txtccemail = "mfc@msn.com"
Me.txtemail = "drnorbert@msn.com"
            
Set objOL = New Outlook.Application
Set objNS = objOL.GetNamespace("MAPI")
objNS.Logon

Set objOItem = objOL.CreateItem(olMailItem)
Set objSafeItem = CreateObject("Redemption.SafeMailItem")
objSafeItem.Item = objOItem 'set Item property

objSafeItem.Recipients.Add Me.txtemail

If Len(strCC) > 0 Then
    objSafeItem.Recipients.AddEx strCC, Me.txtccemail, "SMTP", olCC
End If

objSafeItem.Recipients.ResolveAll
objSafeItem.Subject = Me.txtSubject
objSafeItem.Body = Me.txtMessage & vbCrLf & vbCrLf & Me.txtSignature
objSafeItem.Attachments.Add Me.txtFile
objSafeItem.Send

Me.txtSent.Visible = True
Me.txtSent = "REPORT(s) emailed...."

End Sub


Question:

1-Can a flag from Outlook be sent to Access which verifies that the email was sent?

2-Can the email be send from a selecting a different account (not the default account)?


Thanks


Norbert



__._,_.___

Posted by: drnorbert@msn.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

.

__,_._,___

Tidak ada komentar:

Posting Komentar