Emailing from Excel using Outlook

J

Jason

I am using the following code to email users within my company their cell
phone details. This code is part of a loop that will email to 300+ users.
My problem is that outlook prompts me for each email with the following
message:

"A program is trying to send email on your behalf. Would you like to
continue?"

Is there a way to disable or prevent this message from showing to eliminate
300+ mouse clicks?

Much appreciated.

Jason



'email
Dim myOutlok As Object
Dim myMailItm As Object

Set otlApp = CreateObject("Outlook.Application")
Set otlNewMail = otlApp.CreateItem(olMailItem)
fName = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name

With otlNewMail
.To = Workbooks(wb_name).Sheets(ws_name).Range("AA" &
phone_row).Value
.CC = Workbooks(wb_name).Sheets(ws_name).Range("AA" &
phone_row).Value
.Subject = "Monthly Cell Phone Bill"
.Body = "Monthly Cell Phone Bill"
.Attachments.Add fName
.Send
End With
 
B

Bob

Ron,

I have not set up an account in Outlook Express or Windows Mail, but I have
set up an account in MS-Office Outlook. I tried using CDOSYS, but I never
received the test e-mail message. Is that the expected behavior?

Thanks,
Bob
 
J

Jie Wang [MSFT]

Hi Jason,

I think Ron has pointed out the right direction.

The dialog you saw is the security mechanism that is not easily removed and
we don't recommend you to remove it.

In your case, I'd recommend you choose other APIs to get the task done,
like CDO. Ron's "Sending mail from Excel with CDO"
(http://www.rondebruin.nl/cdo.htm) is a nice guide to follow.

Regards,
Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jie Wang [MSFT]

Hi Jason,

Any updates on this issue? Does Ron's solution work for you?

Thanks,
Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Top