I have an smallapplication that gets distributed to clients. I have some code to automatically send through Outlook, which works fabulously (I found it on another thread here!). However, what if my client does not use Outlook as their primary email? Here is the code that I currently use. How can it be modified to accomodate for *unknown* email programs?
Code:
Dim strWAEmail, strWABody, strWASubject As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
strWAEmail = "recipient name goes here"
strWASubject = "Subject of Email"
strWABody = "Body of email goes here"
With objEmail
.To = strWAEmail
.SentOnBehalfOfName = "Team.EmailAddress@work.com"
.Subject = strWASubject
.Body = strWABody
.Importance = olImportanceHigh
.Send
End With
Set objEmail = Nothing
MsgBox "message sent"