Send Email VBA



Dear all,

I have a macro that send data from Excel though Microsoft Outlook:

Sub Mail_With_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, strcc As String, strbcc As String
Dim strsub As String, strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strto = Cells(2, 3)
strcc = ""
strbcc = ""
strsub = Cells(2, 1)
strbody = Cells(2, 4)
With OutMail
..To = strto
..CC = strcc
..BCC = strbcc
..Subject = strsub
..Body = strbody
End With
Application.SendKeys "%S"
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

But there is always a message to confirm your sending by press Yes or

'The program is trying to automatically send an emai on your behalf.
'Do you want to allow this?

Could any one help me to skip this message or to press Yes
automatically when the message popups.

Thanks a lot!



Hi Ron de Bruin,

I have read your instruction but I can not find the note 'warn me when

applications try to send mail as me'

I am now using Microsoft Outlook 2002 in my company.

Is there any another way.



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Send Email 4
Email on value change (Formula) 6
E-mail if Cell B33 = Yes 2
?????? 2
Mail Multiple Sheets via PDF Q 5
Converting an Excel file to PDF Q 1
Mail Sheet as message body 1