IF @FG.COM is my company e-mail,@OP.COM is my e-mail,i can use vba sent the email to my company e-mail,but i can't sent to my e-mail. help me
Code:
Sub sendBatchMail()
t = Timer
Dim rowCount, endRowNo
Dim objOutlook As New Outlook.Application
Dim objMail As MailItem
Dim sendIndex
endRowNo = ThisWorkbook.Sheets("Sheet1").[a65535].End(xlUp).Row
Set objOutlook = New Outlook.Application
ThisWorkbook.Sheets("Sheet1").Select
For rowCount = 2 To endRowNo
Set objMail = objOutlook.CreateItem(olMailItem)
subjectname = ThisWorkbook.Sheets("sheet1").Range("b" & rowCount)
bodyname = ThisWorkbook.Sheets("sheet1").Range("c" & rowCount)
attach_address = ThisWorkbook.Sheets("sheet1").Range("d" & rowCount)
With objMail
.To = Cells(rowCount, 1)
.Body = bodyname
.Subject = subjectname
.Send
End With
Set objMail = Nothing
Application.Wait (Now + TimeValue("0:00:1"))
Next
MsgBox "Done!" & Chr(10) & "Run time is " & Timer - t & "seconds"
End Sub