Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello everyone. I stole the following piece of code from Ron deBruin's web
site. I am trying to automatically send an e-mail without all the new Outlook security prompts. The code I grabbed is below. But when I run, I get a "The SendUsing Configuration value is invalid". Any idea how to fix? Sub Message() ' This example use late binding, you don't have to set a reference ' You must be online when you run the sub Dim iMsg As Object Dim iConf As Object Dim cell As Range ' Dim Flds As Variant Application.ScreenUpdating = False ' 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 For Each cell In Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants) If cell.Offset(0, 1).Value < "" Then If cell.Value Like "*@*" And cell.Offset(0, 1).Value = "yes" Then Set iMsg = CreateObject("CDO.Message") With iMsg Set .Configuration = iConf .To = cell.Value .From = """Ron"" " .Subject = "Reminder" .TextBody = "Dear " & cell.Offset(0, -1).Value & vbNewLine & vbNewLine & _ "Please contact us to discuss bringing your account up to date" .Send End With Set iMsg = Nothing End If End If Next cell Set iConf = Nothing Application.ScreenUpdating = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
General mail failure when sending e-mail from Excel | Excel Discussion (Misc queries) | |||
Sending E-mail | Excel Worksheet Functions | |||
Help sending mail... | Excel Programming | |||
Help sending mail... | Excel Programming | |||
Sending mail from excel with CDO | Excel Programming |