LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default How Email does not need user interaction ?

Be sure the SMTP server is correct

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Koulla" wrote in message ...
I put also the comments and now the error is "Cannot Connect to the Server "

"Koulla" wrote:

Hi I just try it but the following error appers
Send using configuration value is invalid
Any help here ??
Thanks

"Mike H" wrote:

Hi,

This may work for you

http://www.rondebruin.nl/cdo.htm

Mike

"Koulla" wrote:

Hi I am trying to send email with Microsoft Outlook from Excel using VBA
code!!
Here is my code and is working Perfect

With Application
.EnableEvents = False
.ScreenUpdating = False
End With


Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "This is a test!" & vbNewLine & _
"Please ignore it"

With OutMail
.To = "xxxxxxxxx"
.CC = ""
.BCC = ""
.Subject = "Here is Counters Alarm file date " & datevar & " and time "
& hourvar & ".XLS"
.Body = strbody
.Attachments.Add (dirvar & "Counters_" & datevar & "_" & hourvar &
".xls")
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")

.send
End With

With Application
.EnableEvents = True
.ScreenUpdating = True
End With

Set OutMail = Nothing
Set OutApp = Nothing

But my problem is that before sending it it needs a user interaction because
the following message appears from the Microsoft Office Outlook
"A program is trying to automatically send e-mail on your behalf. Do you
want to allow this ? If this is unexpected, it may be a virus and you should
choose "No" "
and the user have to select an option Yes or No. But I dont want this I want
the default option to be YES. How can I do this via my code ??? Or is there
any option in the Microsoft Office Outlook to do it just once ??
Thanks in advance



 
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
can i email an excel spreadsheet from office 2003 to a mac user trishia50 New Users to Excel 1 December 1st 06 04:51 AM
Excel email attachments print differently for each user, why? Nick Hodge Excel Discussion (Misc queries) 0 November 1st 06 07:36 AM
Auto email - With every new entry on my user form Vikram Excel Discussion (Misc queries) 0 June 19th 06 06:00 AM
HOw DO I EMAIL AN EXEL MACRO TO ANTOEHR USER? leo Excel Discussion (Misc queries) 2 December 11th 05 06:02 PM
Excel and web interaction Scott Excel Discussion (Misc queries) 0 November 13th 05 07:11 PM


All times are GMT +1. The time now is 08:28 PM.

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"