Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDO to Send messages

Status
Not open for further replies.

ggrewe

IS-IT--Management
Joined
Jul 10, 2001
Messages
169
Location
US
Hello,

I have an application running MS VFP 7.0 on a W2K server, trying to send e-mail through an Exchange 2000 (SP3) server that resides internally on another W2K server. I am trying to use CDO to send a simple SMTP message to a customer. This works well to any internal address, but I cannot make it send a message outside. Originally I was getting a relay error, so I added the code to do smtp authentication. Now it will not work at all. ANy help is greatly appreciated.

LPARAMETERS lc_FileName, lc_FirstName, lc_LastName, lc_Email

LOCAL lc_Body, lo, lo_Item
LOCAL objMail, objConfig, objFields

lc_Body = 'Dear ' + ALLTRIM(lc_FirstName) + ' ' + ALLTRIM(lc_LastName) + ';' + CHR(13) + CHR(13) + ...

objMail = CreateObject("CDO.Message")
objConfig = CreateObject("CDO.Configuration")
objFields = objConfig.Fields

WITH objFields
.Item(" 2 &&& SMTP/POP Server
.Item(" "mailserver"
.Item(" 25
.Item(" = 10
.Item(" = 1
.Item(" = "id"
.Item(" = "password"
.Update
ENDWITH

WITH objMail
.Configuration = objConfig
.From = "sales@gorb.net"
.To = lc_email
.Subject = "Home Comfort System Proposal from Recker and Boerger"
.TextBody = lc_Body
.AddAttachment(lc_FileName + ".PDF")
.Send
ENDWITH

RELEASE objMail, objConfig, objFields

RETURN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top