|
You
could also send email using SMTP. We use this here as certain security
patches/service releases prevent the automatic outlook
email.
Dim
Mail As Variant
Dim Config As Variant Dim Fields As Variant Function SendEmail(pSubject As String, pFrom As String, pBodyLine As
String, pEmailAddress As String, Optional pAttachment As String)
'email for SMTP Wait 1 Set Mail = CreateObject("CDO.Message") Set Config = CreateObject("CDO.configuration") Set Fields = Config.Fields With
Fields
.Item("http://schemas.microsoft.com/cdo/configuration/SendUsing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "relay.ummhc.org" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Update End With With
Mail
Set .Configuration = Config .To = pEmailAddress .From = pFrom .Subject = pSubject .TextBody = pBodyLine If Not Trim(pAttachment) = "" Then .AddAttachment pAttachment End If .Send End With Set Mail = Nothing Set Config = Nothing Set Fields = Nothing End Function
|
- [Talk] Using VBA to send email via Outlook HTaylor
- RE: [Talk] Using VBA to send email via Outl... McClain, Jeff
- RE: [Talk] Using VBA to send email via Outl... Ford, Alice
- RE: [Talk] Using VBA to send email via Outl... Zimmerman, Scott
- RE: [Talk] Using VBA to send email via Outl... HTaylor
- RE: [Talk] Using VBA to send email via Outl... Barker-Lacerda , Michelle
- Re: [Talk] Using VBA to send email via ... Neil Carman
