S
steve
I am getting an alert when using the below code to send mail from Excel.
How do I prevent this alert?
Thanks for your help...
The alert reads:
A program is trying to automatically send e-mail on your behalf.
Do you want to Allow this.
If this is unexpected, it may be a virus and you should choose "No".
Sub SendMyMail()
Dim subj As String
Application.DisplayAlerts = False
If MsgBox("Ready to send?", vbYesNo + vbQuestion) = vbYes Then
subj = Sheets(2).Cells(7, 3) & " Quote "
subj = subj & InputBox("Add to your Subject Line", "email Subject")
subj = WorksheetFunction.Proper(subj)
'(e-mail address removed)
'Emails the activeworkbook'
ActiveWorkbook.SendMail Recipients:="(e-mail address removed)", _
Subject:=subj, ReturnReceipt:=True
End If
Application.DisplayAlerts = True
End Sub
How do I prevent this alert?
Thanks for your help...
The alert reads:
A program is trying to automatically send e-mail on your behalf.
Do you want to Allow this.
If this is unexpected, it may be a virus and you should choose "No".
Sub SendMyMail()
Dim subj As String
Application.DisplayAlerts = False
If MsgBox("Ready to send?", vbYesNo + vbQuestion) = vbYes Then
subj = Sheets(2).Cells(7, 3) & " Quote "
subj = subj & InputBox("Add to your Subject Line", "email Subject")
subj = WorksheetFunction.Proper(subj)
'(e-mail address removed)
'Emails the activeworkbook'
ActiveWorkbook.SendMail Recipients:="(e-mail address removed)", _
Subject:=subj, ReturnReceipt:=True
End If
Application.DisplayAlerts = True
End Sub