Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|