+ Reply to Thread
Results 1 to 3 of 3

.Send Mail - Additional Email Recipient

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    .Send Mail - Additional Email Recipient

    I have the code below but I need to add another email recipient but do not now how? – How do I add Damon@Test.com as a CC

    Also – What would I need to put in the code so I can have “Please see the attached updated Maintenance Schedule” in the body of the email?

       
    With Destwb
    .SaveAs TempFilePath & TempFileName & FileExtStr, _
    
    FileFormat:=FileFormatNum
    
    On Error Resume Next
    
    .SendMail "Paul.Adams@Test.com", _
    
    "Maintenance Schedule"
    
    On Error GoTo 0
    
    Close SaveChanges:=False
    
    End With

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: .Send Mail - Additional Email Recipient

    Hello pauldaddyadams,

    This code sends an email using your default email program. The separator you will use for multiple addresses varies depending on the email program and the version. It may be either a comma or a semicolon. Pick one to use. If you get an error change the separator. Copy this code into a Standard VBA Module. Another possible source of errors depending on your email program, is spaces and other non printable characters may have to be converted to their hexadecimal equivalents to make the characters email safe. If you have problems, let me know.
    'This will Launch the default Email program
     Private Declare Function ShellExecute _
      Lib "Shell32.dll" _
        Alias "ShellExecuteA" _
         (ByVal hWnd As Long, _
          ByVal lpOperation As String, _
          ByVal lpFile As String, _
          ByVal lpParameters As String, _
          ByVal lpDirectory As String, _
          ByVal nShowCmd As Long) As Long
    
    Sub SendEmail(MailTo As String, Subj As String, Message As String, CC As String)
    
      Dim RetVal
      Dim URL As String
    
          URL = "MailTo:" & MailTo & "?subject=" & Subj & "&body=" & Message & "&CC=" & CC
          RetVal = ShellExecute(0&, "open", URL, "", "", vbHide)
        
    End Sub
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: .Send Mail - Additional Email Recipient

    Where would i put the email address, Subject and Body on the code you gave me?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1