#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel CDO

I'm trying to bypass Outlook to send an email with a csv attachment. I used
the code provided by Ron De Bruin (http://www.rondebruin.nl/cdo.htm):
- - - - -
Sub CDO_Mail_Small_Text()
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/smtpserver") _
' = "Fill in your SMTP server here"
'
..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' .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 = """Ron"" "
.Subject = "Important message"
.TextBody = strbody
.Send
End With

End Sub
- - - - -
... but nothing happens when I run the macro, regardless of whether the
configuration lines are commented or not.

Any advice greatly appreciated.

SQL Servant

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Excel CDO

My first guess, did you change this:
..To = "



--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"SQL Servant" wrote:

I'm trying to bypass Outlook to send an email with a csv attachment. I used
the code provided by Ron De Bruin (http://www.rondebruin.nl/cdo.htm):
- - - - -
Sub CDO_Mail_Small_Text()
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/smtpserver") _
' = "Fill in your SMTP server here"
'
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' .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 = """Ron"" "
.Subject = "Important message"
.TextBody = strbody
.Send
End With

End Sub
- - - - -
... but nothing happens when I run the macro, regardless of whether the
configuration lines are commented or not.

Any advice greatly appreciated.

SQL Servant

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Excel CDO

Have you fill in your smtp sever when you use the commented code ?


--

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


"SQL Servant" wrote in message ...
I'm trying to bypass Outlook to send an email with a csv attachment. I used
the code provided by Ron De Bruin (http://www.rondebruin.nl/cdo.htm):
- - - - -
Sub CDO_Mail_Small_Text()
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/smtpserver") _
' = "Fill in your SMTP server here"
'
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' .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 = """Ron"" "
.Subject = "Important message"
.TextBody = strbody
.Send
End With

End Sub
- - - - -
... but nothing happens when I run the macro, regardless of whether the
configuration lines are commented or not.

Any advice greatly appreciated.

SQL Servant

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel CDO

I did fill in the smtp server and (in reply to John Bundy) I did change the
email address to mine (From and To).... Still no joy.

SQL Servant

"Ron de Bruin" wrote:

Have you fill in your smtp sever when you use the commented code ?


--

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


"SQL Servant" wrote in message ...
I'm trying to bypass Outlook to send an email with a csv attachment. I used
the code provided by Ron De Bruin (http://www.rondebruin.nl/cdo.htm):
- - - - -
Sub CDO_Mail_Small_Text()
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/smtpserver") _
' = "Fill in your SMTP server here"
'
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' .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 = """Ron"" "
.Subject = "Important message"
.TextBody = strbody
.Send
End With

End Sub
- - - - -
... but nothing happens when I run the macro, regardless of whether the
configuration lines are commented or not.

Any advice greatly appreciated.

SQL Servant


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Excel CDO

No errors ?

--

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


"SQL Servant" wrote in message ...
I did fill in the smtp server and (in reply to John Bundy) I did change the
email address to mine (From and To).... Still no joy.

SQL Servant

"Ron de Bruin" wrote:

Have you fill in your smtp sever when you use the commented code ?


--

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


"SQL Servant" wrote in message ...
I'm trying to bypass Outlook to send an email with a csv attachment. I used
the code provided by Ron De Bruin (http://www.rondebruin.nl/cdo.htm):
- - - - -
Sub CDO_Mail_Small_Text()
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/smtpserver") _
' = "Fill in your SMTP server here"
'
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' .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 = """Ron"" "
.Subject = "Important message"
.TextBody = strbody
.Send
End With

End Sub
- - - - -
... but nothing happens when I run the macro, regardless of whether the
configuration lines are commented or not.

Any advice greatly appreciated.

SQL Servant




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel CDO

No errors. Nothing happens.

"Ron de Bruin" wrote:

No errors ?

--

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


"SQL Servant" wrote in message ...
I did fill in the smtp server and (in reply to John Bundy) I did change the
email address to mine (From and To).... Still no joy.

SQL Servant

"Ron de Bruin" wrote:

Have you fill in your smtp sever when you use the commented code ?


--

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


"SQL Servant" wrote in message ...
I'm trying to bypass Outlook to send an email with a csv attachment. I used
the code provided by Ron De Bruin (http://www.rondebruin.nl/cdo.htm):
- - - - -
Sub CDO_Mail_Small_Text()
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/smtpserver") _
' = "Fill in your SMTP server here"
'
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' .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 = """Ron"" "
.Subject = "Important message"
.TextBody = strbody
.Send
End With

End Sub
- - - - -
... but nothing happens when I run the macro, regardless of whether the
configuration lines are commented or not.

Any advice greatly appreciated.

SQL Servant



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



All times are GMT +1. The time now is 01:32 AM.

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"