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 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
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Ford, Alice
Sent: Tuesday, August 02, 2005 12:28 PM
To: [email protected]
Subject: RE: [Talk] Using VBA to send email via Outlook

There's an example on the website that was very helpful to us.

 

Alice Ford

Sr. Applications Analyst

Maury Regional Hospital

931-540-4251

Fax 931-490-3896

[EMAIL PROTECTED]

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of [EMAIL PROTECTED]
Sent: Monday, August 01, 2005 1:49 PM
To: [email protected]
Subject: [Talk] Using VBA to send email via Outlook

 

I could spend a whole bunch of time looking around the web to try to find what I need, but I'm hoping someone on the listserv has done this and would be willing to share some code. We are switching from using Lotus Notes ot using Outlook at the end of this month. I need to rewrite all of my scirpts that use email to use the new client. Is anyone out there doing this? If so, would you be willing to share your code?

Henry Taylor
Technical Analyst II
Lutheran Health Network
Ph. (260) 425-3914

"EMF <mrhs.com>" made the following annotations.
------------------------------------------------------------------------------
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
==============================================================================

Reply via email to