+ Reply to Thread
Results 1 to 6 of 6

Send Email in Outlook

Hybrid View

  1. #1
    Registered User
    Join Date
    06-15-2018
    Location
    Köln, Germany
    MS-Off Ver
    2013
    Posts
    4

    Send Email in Outlook

    Can someone please help me out I am totally stuck with a task. I am creating a vba for an email which needs to be send every month to various recipients and I want vba to extract "to" and "cc" from an excel file.

    Can someone please help me with the code?

    Regards.

  2. #2
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Send Email in Outlook

    Please check out here:
    https://powerspreadsheets.com/send-email-excel-vba/
    Regards,
    Thangavel D

    Appreciate the help? CLICK *

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,400

    Re: Send Email in Outlook

    .
    Paste in a Routine Module, run with Command Button :

    Option Explicit
    
    Sub Mail_workbook_Outlook()
    
    
        Dim OutApp As Object
        Dim OutMail As Object
        Dim sndEmail As String
        Dim ccEmail As String
        Dim bccEmail As String
    
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
        toEmail = Sheets("EMAIL").Range("D2").Value
        ccEmail = Sheets("EMAIL").Range("D3").Value
        bccEmail = Sheets("EMAIL").Range("D4").Value
    
        On Error Resume Next
        With OutMail
            .To = sndEmail
            .CC = ccEmail
            .BCC = bccEmail
            .Subject = "Spare Parts Maintenance"
            .Body = "The parts have been placed on today's load sheet and will be processed by EOB today.  The parts have also been transferred to the repository file."
            .Attachments.Add (Application.ActiveWorkbook.FullName) 'attaches this workbook to email
            
            '.Send                              '<-- .Send will auto send email without review
            .Display                            '<-- .Display will show the email first for review
        End With
        On Error GoTo 0
    
    
        Set OutMail = Nothing
        Set OutApp = Nothing
    End Sub
    Last edited by Logit; 06-15-2018 at 04:27 PM.

  4. #4
    Registered User
    Join Date
    06-15-2018
    Location
    Köln, Germany
    MS-Off Ver
    2013
    Posts
    4

    Re: Send Email in Outlook

    Quote Originally Posted by Logit View Post
    .
    Paste in a Routine Module, run with Command Button :

    Option Explicit
    
    Sub Mail_workbook_Outlook()
    
    
        Dim OutApp As Object
        Dim OutMail As Object
        Dim sndEmail As String
        Dim ccEmail As String
        Dim bccEmail As String
    
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
        toEmail = Sheets("EMAIL").Range("D2").Value
        ccEmail = Sheets("EMAIL").Range("D3").Value
        bccEmail = Sheets("EMAIL").Range("D4").Value
    
        On Error Resume Next
        With OutMail
            .To = sndEmail
            .CC = ccEmail
            .BCC = bccEmail
            .Subject = "Spare Parts Maintenance"
            .Body = "The parts have been placed on today's load sheet and will be processed by EOB today.  The parts have also been transferred to the repository file."
            .Attachments.Add (Application.ActiveWorkbook.FullName) 'attaches this workbook to email
            
            '.Send                              '<-- .Send will auto send email without review
            .Display                            '<-- .Display will show the email first for review
        End With
        On Error GoTo 0
    
    
        Set OutMail = Nothing
        Set OutApp = Nothing
    End Sub
    Thank you

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,400

    Re: Send Email in Outlook

    .
    You are welcome.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,400

    Re: Send Email in Outlook

    .
    Here is the updated version :
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Send email from shared Outlook email address
    By rousseauassociates in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2016, 07:33 AM
  2. Send an email via outlook from and address other than your default email.
    By sungen99 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-28-2015, 06:15 PM
  3. Email Macro o send Outlook Email
    By asivaprakash in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2013, 07:05 PM
  4. send selected range in email with default outlook email signature included
    By mdsickler in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2013, 10:50 PM
  5. Send Email from outlook
    By wawansur in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2010, 04:09 AM
  6. Send email without using outlook
    By waspandbee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2010, 08:48 AM
  7. VBA to Send Outlook Email
    By Larry.LeBlanc@O in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2009, 02:22 PM

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