Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Send web mail from Excel (VBA)??

Hi,

is it possible to do the following in VBA:

I run a lenthy simulation on another computer and would like the
program to send me an emai when it is finished.

If I do this using MS Outlook i get a security warning which asks to
press "OK". So not much automation after all.
Can I send an email automatically using a web email account like gmail
or hotmail?


Thanks a lot?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Send web mail from Excel (VBA)??

Hi MaxS

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

--
Regards Ron de Bruin
http://www.rondebruin.nl



"MaxS" wrote in message oups.com...
Hi,

is it possible to do the following in VBA:

I run a lenthy simulation on another computer and would like the
program to send me an emai when it is finished.

If I do this using MS Outlook i get a security warning which asks to
press "OK". So not much automation after all.
Can I send an email automatically using a web email account like gmail
or hotmail?


Thanks a lot?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Send web mail from Excel (VBA)??

Thanks a lot, Ron
Will check it now.

Best,

Max

Ron de Bruin wrote:

Hi MaxS

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

--
Regards Ron de Bruin
http://www.rondebruin.nl



"MaxS" wrote in message oups.com...
Hi,

is it possible to do the following in VBA:

I run a lenthy simulation on another computer and would like the
program to send me an emai when it is finished.

If I do this using MS Outlook i get a security warning which asks to
press "OK". So not much automation after all.
Can I send an email automatically using a web email account like gmail
or hotmail?


Thanks a lot?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Send web mail from Excel (VBA)??

Hi Ron,

your site helped and I could send the message via my gmail account.
However when I run the same code from work i get the following message:

"ActiveX component can't create object" on the line of code
"Set iConf = CreateObject(" CDO.Configuration")"

I have Win XP and Office 2002 at home and in the office. So the systems
are the same.

Any ideas why this can happen?

Here goes my code:

Sub Mail_Small_Text_CDO()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject(" CDO.Configuration")

' iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

..Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate
") = 1

..Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtp.gmail.com "

..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 465
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusername") =
"
.Item("
http://schemas.microsoft.com/cdo/configuration/sendpassword") = "my
pass"

..Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl ") =
True
.Update
End With

strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """MasS"" < "
.Subject = "Important message"
.TextBody = strbody
.Send
End With



Set iMsg = Nothing
Set iConf = Nothing
End Sub












Ron de Bruin wrote:

Hi MaxS

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

--
Regards Ron de Bruin
http://www.rondebruin.nl



"MaxS" wrote in message oups.com...
Hi,

is it possible to do the following in VBA:

I run a lenthy simulation on another computer and would like the
program to send me an emai when it is finished.

If I do this using MS Outlook i get a security warning which asks to
press "OK". So not much automation after all.
Can I send an email automatically using a web email account like gmail
or hotmail?


Thanks a lot?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Send web mail from Excel (VBA)??

Max,
At a guess, it looks like you have a extra leading space in "
CDO.Configuration".

NickHK

"MaxS" wrote in message
oups.com...
Hi Ron,

your site helped and I could send the message via my gmail account.
However when I run the same code from work i get the following message:

"ActiveX component can't create object" on the line of code
"Set iConf = CreateObject(" CDO.Configuration")"

I have Win XP and Office 2002 at home and in the office. So the systems
are the same.

Any ideas why this can happen?

Here goes my code:

Sub Mail_Small_Text_CDO()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject(" CDO.Configuration")

' iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate
") = 1

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtp.gmail.com "

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 465
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusername") =
"
.Item("
http://schemas.microsoft.com/cdo/configuration/sendpassword") = "my
pass"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl ") =
True
.Update
End With

strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """MasS"" < "
.Subject = "Important message"
.TextBody = strbody
.Send
End With



Set iMsg = Nothing
Set iConf = Nothing
End Sub












Ron de Bruin wrote:

Hi MaxS

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

--
Regards Ron de Bruin
http://www.rondebruin.nl



"MaxS" wrote in message

oups.com...
Hi,

is it possible to do the following in VBA:

I run a lenthy simulation on another computer and would like the
program to send me an emai when it is finished.

If I do this using MS Outlook i get a security warning which asks to
press "OK". So not much automation after all.
Can I send an email automatically using a web email account like gmail
or hotmail?


Thanks a lot?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Send web mail from Excel (VBA)??

Thanks Nick!
I indeed missed that. Now however I get another error "The SendUsing
configuration value is invalid" but this probably has something to do
with company security settings, I guess..


NickHK wrote:

Max,
At a guess, it looks like you have a extra leading space in "
CDO.Configuration".

NickHK

"MaxS" wrote in message
oups.com...
Hi Ron,

your site helped and I could send the message via my gmail account.
However when I run the same code from work i get the following message:

"ActiveX component can't create object" on the line of code
"Set iConf = CreateObject(" CDO.Configuration")"

I have Win XP and Office 2002 at home and in the office. So the systems
are the same.

Any ideas why this can happen?

Here goes my code:

Sub Mail_Small_Text_CDO()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject(" CDO.Configuration")

' iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate
") = 1

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtp.gmail.com "

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 465
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusername") =
"
.Item("
http://schemas.microsoft.com/cdo/configuration/sendpassword") = "my
pass"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl ") =
True
.Update
End With

strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """MasS"" < "
.Subject = "Important message"
.TextBody = strbody
.Send
End With



Set iMsg = Nothing
Set iConf = Nothing
End Sub












Ron de Bruin wrote:

Hi MaxS

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

--
Regards Ron de Bruin
http://www.rondebruin.nl



"MaxS" wrote in message

oups.com...
Hi,

is it possible to do the following in VBA:

I run a lenthy simulation on another computer and would like the
program to send me an emai when it is finished.

If I do this using MS Outlook i get a security warning which asks to
press "OK". So not much automation after all.
Can I send an email automatically using a web email account like gmail
or hotmail?


Thanks a lot?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Send web mail from Excel (VBA)??

Max,
Couldn't answer you on that one.
Ron's your man when it all things CDO.

NickHK

"MaxS" wrote in message
oups.com...
Thanks Nick!
I indeed missed that. Now however I get another error "The SendUsing
configuration value is invalid" but this probably has something to do
with company security settings, I guess..


NickHK wrote:

Max,
At a guess, it looks like you have a extra leading space in "
CDO.Configuration".

NickHK

"MaxS" wrote in message
oups.com...
Hi Ron,

your site helped and I could send the message via my gmail account.
However when I run the same code from work i get the following

message:

"ActiveX component can't create object" on the line of code
"Set iConf = CreateObject(" CDO.Configuration")"

I have Win XP and Office 2002 at home and in the office. So the

systems
are the same.

Any ideas why this can happen?

Here goes my code:

Sub Mail_Small_Text_CDO()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject(" CDO.Configuration")

' iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate
") = 1

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtp.gmail.com "

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 465
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusername") =
"
.Item("
http://schemas.microsoft.com/cdo/configuration/sendpassword") = "my
pass"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl ") =
True
.Update
End With

strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """MasS"" < "
.Subject = "Important message"
.TextBody = strbody
.Send
End With



Set iMsg = Nothing
Set iConf = Nothing
End Sub












Ron de Bruin wrote:

Hi MaxS

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

--
Regards Ron de Bruin
http://www.rondebruin.nl



"MaxS" wrote in message

oups.com...
Hi,

is it possible to do the following in VBA:

I run a lenthy simulation on another computer and would like the
program to send me an emai when it is finished.

If I do this using MS Outlook i get a security warning which asks

to
press "OK". So not much automation after all.
Can I send an email automatically using a web email account like

gmail
or hotmail?


Thanks a lot?





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Send web mail from Excel (VBA)??

Hi Max

If you not have a account in Outlook Express you must use the commented code lines in the examples on my site.
Read the text on my site

--
Regards Ron de Bruin
http://www.rondebruin.nl



"MaxS" wrote in message oups.com...
Thanks Nick!
I indeed missed that. Now however I get another error "The SendUsing
configuration value is invalid" but this probably has something to do
with company security settings, I guess..


NickHK wrote:

Max,
At a guess, it looks like you have a extra leading space in "
CDO.Configuration".

NickHK

"MaxS" wrote in message
oups.com...
Hi Ron,

your site helped and I could send the message via my gmail account.
However when I run the same code from work i get the following message:

"ActiveX component can't create object" on the line of code
"Set iConf = CreateObject(" CDO.Configuration")"

I have Win XP and Office 2002 at home and in the office. So the systems
are the same.

Any ideas why this can happen?

Here goes my code:

Sub Mail_Small_Text_CDO()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject(" CDO.Configuration")

' iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate
") = 1

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtp.gmail.com "

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 465
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusername") =
"
.Item("
http://schemas.microsoft.com/cdo/configuration/sendpassword") = "my
pass"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl ") =
True
.Update
End With

strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """MasS"" < "
.Subject = "Important message"
.TextBody = strbody
.Send
End With



Set iMsg = Nothing
Set iConf = Nothing
End Sub












Ron de Bruin wrote:

Hi MaxS

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

--
Regards Ron de Bruin
http://www.rondebruin.nl



"MaxS" wrote in message

oups.com...
Hi,

is it possible to do the following in VBA:

I run a lenthy simulation on another computer and would like the
program to send me an emai when it is finished.

If I do this using MS Outlook i get a security warning which asks to
press "OK". So not much automation after all.
Can I send an email automatically using a web email account like gmail
or hotmail?


Thanks a lot?





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
Bypass: A program is trying to send mail using Item.Send prompt Vick Excel Discussion (Misc queries) 1 June 25th 09 03:31 AM
how to send mail with excel vba EXCEL$B!!(BNEWS Excel Programming 4 April 6th 06 11:08 AM
Send mail from Excel Steve C.[_3_] Excel Programming 3 August 21st 04 03:26 AM
Not using send button on excel e-mail Richard Excel Programming 3 April 2nd 04 05:14 PM
how to send e-mail from excel Barmaley Excel Programming 3 August 22nd 03 04:26 PM


All times are GMT +1. The time now is 07:00 AM.

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

About Us

"It's about Microsoft Excel"