a program is trying to automatically send e-mail

A

ARN

Can any one help in following.
I've an excel file which send email automatically,when i
press a command button( a macro assigned to it). It was
working perfectly in Office 2000, when i moved to office
XP it started showing the following message
"a program is trying to automatically send e-mail on your
behalf". How can avoid this message. I want to send the
mail without asking this question.

HERE IS THE CODE THAT I AM USING
================================
' Sub mail_with_outlook()

Dim Outapp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim strto As String

Dim strsub As String
Set Outapp = CreateObject("Outlook.application")
Set OutMail = Outapp.CreateItem(olMailItem)
strto = "(e-mail address removed)"
strsub = Sheets("Sheet1").Range("A1").Value
With OutMail
.To = strto
.Body = strsub
.ReadReceiptRequested = True
On Error Resume Next
.Send
Sheets("Sheet1").Range("A1").Value = ""
End With

End Sub
 

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

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

Top