Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ARN ARN is offline
external usenet poster
 
Posts: 1
Default a program is trying to automatically send e-mail

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 = "
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default a program is trying to automatically send e-mail

Take a look her http://www.rondebruin.nl/sendmail.htm#Prevent

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ARN" wrote in message
...
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 = "
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Send Lous Notes 7 mail from Excel 2007 automatically apatil1 New Users to Excel 0 January 21st 11 09:59 AM
Bypass: A program is trying to send mail using Item.Send prompt Vick Excel Discussion (Misc queries) 1 June 25th 09 03:31 AM
Send e-mail Andrea Excel Discussion (Misc queries) 3 March 25th 07 12:37 PM
Macro to automatically open a website or send an e-mail in excel Byron Excel Discussion (Misc queries) 3 April 7th 06 09:05 AM
Send Mail janet Excel Programming 2 July 22nd 03 10:06 PM


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"