• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Automatically Send Mass emails

Abhijeet

Active Member
Hi

I have macro but that macro not send emails automatically please tell me how to do this
 

Attachments

  • send Emails.xlsm
    17.1 KB · Views: 16
Yes Chihiro

Its Work i just change this
Code:
If Sheet1.Range("G" & I).Value <> "" Then
                If Dir(Sheet1.Range("G" & I).Value) <> "" Then .Attachments.Add Sheet1.Range("G" & I).Value
            End If
            .Send ' or use .send
        End With
        Set olMail = Nothing
 
Yes I read this i do not have access in my Office so i want to use Send Keys in Code so please tell me how to do this
 
Please tell me how to do this with help of SendKeys in Code

Hi Abhijeeet,

change macro setting of outlook to always run macro save & exit and then run code in debug mode (F8) with ".send" ....send more than two mail in debug mode and then problem will solve....

I had same problem & now this resolved..
 
Dear Abhijeet...,

Run your macro in debug mode..i.e pressing F8...just send 2-3 mails by using F8 keys...then it will not ask you for allow/deny option.....If not then you have to turn on options as below :

upload_2016-6-13_21-3-43.png

upload_2016-6-13_21-4-6.png
 
Hi

Thanks for every one support my problem is solved now This is work
Code:
Sub send_email()
    Dim I As Long
   
    Dim olApp As Outlook.Application
    Dim olMail As MailItem
    Set olApp = New Outlook.Application
   
        For I = 2 To Sheet1.Range("A1048576").End(xlUp).Row

        Set olMail = olApp.CreateItem(olMailItem)
        With olMail
            .To = Sheet1.Range("B" & I)
            .CC = Sheet1.Range("C" & I)
            .BCC = Sheet1.Range("D" & I)
            .Subject = Sheet1.Range("E" & I)
            .Body = "Dear " & _
                    Sheet1.Range("A" & I) & "," & vbNewLine & vbNewLine & _
                    Sheet1.Range("F" & I) & vbNewLine & _
                    Sheet1.Range("H" & I)
            If Sheet1.Range("G" & I).Value <> "" Then
                If Dir(Sheet1.Range("G" & I).Value) <> "" Then .Attachments.Add Sheet1.Range("G" & I).Value
            End If
            .Display
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"
 
        End With
        Set olMail = Nothing
    Next
     
    Set olApp = Nothing
End Sub
 
Back
Top