C
cw_lynn
I have a script (shown below) which allows me to send a mass mailin
from Excel, but I am required to click yes in Outlook stating that I a
indeed trying to send a message. The help section indicates that thi
is due to the use of the Item.Send function. Is there a way to tur
this off or automate the Yes button? Funny thing is the button will no
allow you to press Yes for 5 seconds after the msg appears. I have 200
emails to send, so that's like 15+ minutes of pushing Yes...
Thanks for any ideas.
Chris
Sub SendEmail()
Dim OutlookApp As Outlook.Application
Dim MItem As Outlook.MailItem
Dim cell As Range
Dim Subj As String
Dim EmailAddr As String
Dim Recipient As String
Set OutlookApp = New Outlook.Application
For Each cell In Columns("G").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "*@*" Then
Subj = "Monthly Market Survey"
Recipient = cell.Offset(0, -1).Value
EmailAddr = cell.Value
Msg = "Dear " & Recipient & vbCrLf & vbCrLf
Msg = Msg & "You have received this automated message because you
Market Survey has not yet been logged in. Please submit to me a
(e-mail address removed). If you have any questions or believe you receive
this message in error, please contact me at (123) 456-7890." & vbCrLf
vbCrLf
Msg = Msg & "Thanks." & vbCrLf & vbCrLf
Msg = Msg & "Chris"
Set MItem = OutlookApp.CreateItem(olMailItem)
With MItem
.To = EmailAddr
.Subject = Subj
.Body = Msg
.Send
End With
End If
Next
End Su
from Excel, but I am required to click yes in Outlook stating that I a
indeed trying to send a message. The help section indicates that thi
is due to the use of the Item.Send function. Is there a way to tur
this off or automate the Yes button? Funny thing is the button will no
allow you to press Yes for 5 seconds after the msg appears. I have 200
emails to send, so that's like 15+ minutes of pushing Yes...
Thanks for any ideas.
Chris
Sub SendEmail()
Dim OutlookApp As Outlook.Application
Dim MItem As Outlook.MailItem
Dim cell As Range
Dim Subj As String
Dim EmailAddr As String
Dim Recipient As String
Set OutlookApp = New Outlook.Application
For Each cell In Columns("G").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "*@*" Then
Subj = "Monthly Market Survey"
Recipient = cell.Offset(0, -1).Value
EmailAddr = cell.Value
Msg = "Dear " & Recipient & vbCrLf & vbCrLf
Msg = Msg & "You have received this automated message because you
Market Survey has not yet been logged in. Please submit to me a
(e-mail address removed). If you have any questions or believe you receive
this message in error, please contact me at (123) 456-7890." & vbCrLf
vbCrLf
Msg = Msg & "Thanks." & vbCrLf & vbCrLf
Msg = Msg & "Chris"
Set MItem = OutlookApp.CreateItem(olMailItem)
With MItem
.To = EmailAddr
.Subject = Subj
.Body = Msg
.Send
End With
End If
Next
End Su