Results 1 to 2 of 2

How to reply to an e-mail

Threaded View

  1. #1
    Registered User
    Join Date
    09-10-2014
    Location
    Earth
    MS-Off Ver
    2013
    Posts
    10

    How to reply to an e-mail

    HI everybody.

    I am using the code below to send e-mails using vba. What the macro is doing is; take the contact form one excel sheet and send an e-mail to all of them.

    My idea is to use an e-mail as a reference so I can reply to this e-mail using the contact on the e-mail (TO and CC contact).

    Any ideas?
    Sub SendEmail(contact As String, subject As String, body As String)
    Dim app As Outlook.Application
    Set app = CreateObject("outlook.application")
    Dim mail As Outlook.MailItem
    Set mail = app.CreateItem(olMailItem)
    mail.To = contact
    mail.subject = subject
    mail.body = body
    mail.Send
    End Sub
    Sub SendMassEmail()
    Row = 1
    Do
    DoEvents
    Row = Row + 1
    Call SendEmail(Sheet1.Range("a" & Row), "test macro", "I am sending this e-mail using macro")
    Loop Until Row = 4
    End Sub
    Last edited by Leith Ross; 09-10-2014 at 12:20 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 05-14-2013, 01:11 PM
  2. [SOLVED] Sending mail with CDO through a remote SMTP server - problem with Reply To address
    By Bill4786 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2012, 12:43 PM
  3. Replies: 1
    Last Post: 06-12-2012, 11:13 AM
  4. How to e-mail selected row and use e-mail address in a cell to send e-mail from excel
    By syedalamgir in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-27-2010, 02:15 AM
  5. [SOLVED] Reply
    By JohnUK in forum Excel General
    Replies: 1
    Last Post: 02-27-2005, 04:06 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