ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sending e-mail with Excel (https://www.excelbanter.com/excel-programming/400569-sending-e-mail-excel.html)

djExcel

Sending e-mail with Excel
 
I have a program which sends e-mail to a group of people. Program works fine
but I would like to get rid of the confirmation which Outlook asks every time
e-mail is sent (A program is trying to automatically send e-mail on your
behalf...).

Here is the code itself.

Sub Create_mail(Mail_address As String)
Dim AppMail As Object
Set AppMail = CreateObject("OutLook.Application")
With AppMail.CreateItem(0)
.To = Mail_address
.Subject = "Subject"
.Body = "Bodytext."
.Send
End With
Set AppMail = Nothing
End Sub


John

Sending e-mail with Excel
 
The message is a security warning which I don't think you can override!
Ron Debruin has some excellent code which may help:
http://www.rondebruin.nl/sendmail.htm
--
JB


"djExcel" wrote:

I have a program which sends e-mail to a group of people. Program works fine
but I would like to get rid of the confirmation which Outlook asks every time
e-mail is sent (A program is trying to automatically send e-mail on your
behalf...).

Here is the code itself.

Sub Create_mail(Mail_address As String)
Dim AppMail As Object
Set AppMail = CreateObject("OutLook.Application")
With AppMail.CreateItem(0)
.To = Mail_address
.Subject = "Subject"
.Body = "Bodytext."
.Send
End With
Set AppMail = Nothing
End Sub



All times are GMT +1. The time now is 03:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com