Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop Prompt Pop up when sending email using Outlook objects?

Status
Not open for further replies.

apexbs

Technical User
Jun 2, 2002
42
CA
Dear All;

I am using VB.NET 2003 and I am using following code to send emails using Outlook object. When its sending email Outlook prompts a popup of security alert and Ask user to you want to allow to send that email and I can selected check box to allow and selected minutes how long the user will have access to send email using outlook. After selecting Yes, it gives another prompt which and there are option to select yes or no for further time.

I want to stop that prompt, b/c it is pretty annoying for user b/c I have to send emails to so many recipient at the click on one button. How can I stop that prompt to pop up?


Private Function SendEmail(ByVal sendTo As String)

Dim Counter As Integer
Dim oNewMail As Outlook.MailItem
Dim objOLApp As Outlook.Application
Dim oAttachment
Dim x As Short

Try

objOLApp = New Outlook.Application
oNewMail = objOLApp.CreateItem(Outlook.OlItemType.olMailItem)
With oNewMail
.Subject = "New Report Available"
.Body = "New reporting information has Posted"
.BodyFormat = Outlook.OlBodyFormat.olFormatRichText
.Recipients.Add(sendTo)
.Send()
End With

oNewMail = Nothing
objOLApp = Nothing

Catch myexp As Exception

MsgBox(myexp.Message, MsgBoxStyle.Critical, STR_VALIDATION)
End Try

End Function
 
Thanks for giving me this link, I think I have to purchase it so I'll look into demo version first.

I have another question, in the same code above posted, Can I use multiple email address with semicolon ";" seperated to send emails to more than one receipient.

Thanks.
 
I am not sure semicolon would work. I believe what I have used is the Recipients Collection Object as in:

myRecipient = myItem.Recipients.Add("email@email.com")

Repeat for each email address.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top