You are reading a single comment by @aggi and its replies. Click here to read the full conversation.
  • guyzzz
    I'm trying to send 600 emails with an attachment.
    I've found a way to do this (google).

    i've got something that will work (from here:
    https://www.mrexcel.com/forum/excel-questions/514468-mail-merge-email-attachments-vba-2.html)

    but I've changed the end to

     With OutMail
                    .To = cell.Value
                    .Subject = "HELLOWORLD"
                    .HTMLBody = strbody
                    
     
                    For Each FileCell In rng.SpecialCells(xlCellTypeConstants)
                        If Trim(FileCell) <> "" Then
                            If Dir(FileCell.Value) <> "" Then
                                .Attachments.Add FileCell.Value
                            End If
                        End If
                    Next FileCell
     
                    .Display
                    Application.Wait (Now + TimeValue("0:00:02"))
                    Application.SendKeys "%s"
                    
    

    However when you send it, there's still a display of the email and it being sent.
    What can do?

    Especially as it's probably close to 1200 mails ackshually.

  • The whole thing looks a bit complicated unless you're looking to send different attachments. I'd go with something like

    .Attachments.Add "c:\my attachment"
    

    By the way, if you're using gmail you may need to add a pause time in between the emails, it doesn't like mulitple emails going through the server one after another.

About

Avatar for aggi @aggi started