Automated email using col1 as subject and col2 as body

Arn0

New Member
Joined
Apr 5, 2012
Messages
1
Hello,

I'm looking for code that will create an email using data from column 1 as the subject, and the data from column 2 as the body. There are multiple rows, but it would create and send a single email from each row. It would iterate through all the rows and all of these emails would be sent to a single address.

I haven't worked with creating emails from excel data yet, but I have Excel for Mac 2011 and have simply been copy and pasting each cell into a gmail window. There are over 500 rows of data... Any help would be appreciated!

-Arn0
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi
Try the following.
Set the email address and uncomment out send.

A lot of info on mailing with Excel here:
http://www.rondebruin.nl/sendmail.htm

Rich (BB code):
Sub Mail_rows()
Dim OutApp As Object
Dim OutMail As Object
Dim EmailSubject As String
Dim EmailSendTo As String
Dim MailBody As String
Dim cell As Range
 
     EmailSendTo = "fred@yahoo.com"
  
     Set rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
     For Each cell In rng
     Rw = cell.Row
     If cell.Value <> "" Then
 
        EmailSubject = cell.Value
        MailBody = Range("B" & Rw).Value
 
'Send Mail
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(o)
        With OutMail
            .Subject = EmailSubject
            .To = EmailSendTo
            .body = MailBody
            .Display
            '.send - uncomment to send
        End With
 
        Set OutMail = Nothing
        Set OutApp = Nothing
        MailBody = ""
        EmailSubject = ""
End If
Next
End Sub
 
Last edited:
Upvote 0
Would it be possible to alter this code to open Thunderbird instead of Outlook?

Set OutApp = CreateObject("Thunderbird.Application")</pre>
 
Upvote 0
Hello
ChDir "C:\Program Files\Thunderbird"
Call Shell("C:\Program Files\Thunderbird\Thunderbird.exe", 1)
 
Upvote 0

Forum statistics

Threads
1,215,982
Messages
6,128,105
Members
449,421
Latest member
AussieHobbo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top