* Sends mail via SMTP FUNCTION CDOMail LPARAMETERS lcMailServer, lcSenderEmail, lcRecipient, lcSubject, lcMessage,lcUsername,lcPassword LOCAL iMsg as CDO.Message iMsg = CreateObject("CDO.Message") LOCAL iConf as CDO.Configuration iConf = CreateObject("CDO.Configuration") Flds = iConf.Fields Flds.Item("http://schemas.microsoft.com/cdo/configuration/cdoSendUsingMethod")=2 Flds.Item("http://schemas.microsoft.com/cdo/configuration/cdoSendUsingMethod/cdoSMTPServer")= lcMailServer Flds.Item("http://schemas.microsoft.com/cdo/configuration/cdoSendUsingMethod/cdoSMTPServerPort")=25 IF !EMPTY(lcUserName) Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")=lcPassword Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")=lcUsername ENDIF Flds.Item("urn:schemas:mailheader:content-type")="text/html" Flds.Update With iMsg .Configuration = iConf .To = lcRecipient .From = lcSenderEmail .Sender = lcSenderEmail .Subject = lcSubject .TextBody = lcMessage *iBp = .AddAttachment("d:\temp\home.htm") *iBp.ContentMediaType="text/html" TRY .Send() CATCH TO loException lcError = loException.aErrors[3] IF ISNULL(lcError) OR lcError = "" lcError = MESSAGE() ENDIF ENDTRY ENDWITH RETURN ""A more robust and machine configuration independent way to do this is to use a raw SMTP component.