Darren DICK
darrend at nimble.com.au
Fri Jun 16 00:52:59 CDT 2006
Hi All I am using some code I poached from this list (From Marty Connelly - actually) to send email via CDO (Code below) I am puzzled though - It is for a mail out of about 20 or 30 pdf files Not enough to trigger an email spam response I would have thought from the host mail server - Anyway... I send a whole swag of test ones using the real persons firstname at tripledee.com.au (I have a catch all for email to tripledee so I get 'em all) Cool - it worked wonderfully well and I did get 'em all with the sequential attachments - excellent - very excited I hade the code looping through a recordset of 27 records and had it putting the !FirstName and the !EmailAddress into the necessary fields - looping beautifully - excellent - but that's it - One recordset loop only it seems - it now refuses to work again - though I have made it work once (since) only sending a single email as per the code below but now it continues to fail the error I am getting is... Err.Number = -2147220977 Err.Description = The server rejected one or more recipient addresses. The server response was: 550 relaying mail to tripledee.com.au is not allowed But I did send 27 of 'em with attachments to tripledee.com.au this morning? - What gives? So...Any suggestions? Many thanks in advance Darren ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sub SendCDO() ' This example use late binding of CDOSys, you don't have to set a Reference ' You must be online to net when you run the sub ' You must be running WinXP or Win2000 Dim cdoMessage As Object Dim objCDOMail As Object Dim strschema As String On Error GoTo ErrorHandler ' Enable error-handling routine. Set cdoMessage = CreateObject("CDO.Message") Set objCDOMail = CreateObject("CDO.Configuration") strschema = "http://schemas.microsoft.com/cdo/configuration/" objCDOMail.Load -1 DoCmd.Hourglass True With objCDOMail.Fields .Item(strschema & "sendusing") = 2 .Item(strschema & "smtpserver") = "mail.bigpond.com" .Item(strschema & "smtpserverport") = 25 .Update End With With cdoMessage Set .Configuration = objCDOMail .to = d.dick at tripledee.com.au .From = "Some Dude <SomeWayCoolDude at someCoolServer.com> .CC = "" .BCC = "" .Subject = "Testing testing 1...2...3..." .TextBody = "Is Anybody there? Hello Hello...." .AddAttachment "C:\10009.pdf" .send End With DoCmd.Hourglass False Set cdoMessage = Nothing Set objCDOMail = Nothing Exit Sub ErrorHandler: DoCmd.Hourglass False Debug.Print Err.Number & "-" & Err.Description Set cdoMessage = Nothing Set objCDOMail = Nothing Exit Sub End Sub