On Wed, 19 Aug 2009 21:44:31 -0400, "MB Software Solutions,   LLC" wrote:
>
> Thanks.  I think that's what I'll do.  The only problem is that I don't
> think blat will work for the folks who need SSL (like gmail, yahoo
> users...probably hotmail too).  Does BLAT work for SSL email accounts?

Hi Mike,

Yes it does:
http://www.vfug.org/Newsletters/Newsletters2.Afp?!_2Q80GGUCQDate=08/31/2008#gb1

But since I wrote that, I've found the following code works very well
without the need of stunnel.

Cheers,

G.


LPARAMETERS tcBodyFileName, tcFrom, tcTo, tcCC, tcSubject, tcUserName,
tcPassword

TRY
        LOCAL lcSchema, loConfig, loMsg, loError, lcErr
        
        lcErr = []
        lcSchema = [http://schemas.microsoft.com/cdo/configuration/]
        loConfig = CREATEOBJECT( [CDO.Configuration])
        WITH loConfig.FIELDS
                .ITEM( lcSchema + [smtpserver]) = [smtp.gmail.com]
                .ITEM( lcSchema + [smtpserverport]) = 465       && ? 587
                .ITEM( lcSchema + [sendusing]) = 2
                .ITEM( lcSchema + [smtpauthenticate]) = .T.
                .ITEM( lcSchema + [smtpusessl]) = .T.
                .ITEM( lcSchema + [sendusername]) = tcUserName
                .ITEM( lcSchema + [sendpassword]) = tcPassword
                .UPDATE
        ENDWITH
        loMsg = CREATEOBJECT( [CDO.Message])
        WITH loMsg
                .Configuration = loConfig
                .FROM = tcFrom
                .TO = tcTo
                .CC = tcCC
                .Subject = tcSubject
*               .TextBody = FILETOSTR( tcBodyFileName)
                .HTMLBody = FILETOSTR( tcBodyFileName)
                .Send()
        ENDWITH

CATCH TO loError
        lcErr = [Error: ] + STR( loError.ERRORNO) + CHR( 13) + ;
                        [LineNo: ] + STR( loError.LINENO) + CHR( 13) + ;
                        [Message: ] + loError.MESSAGE

FINALLY
        RELEASE loConfig, loMsg

        STORE .NULL. TO loConfig, loMsg

        IF EMPTY( lcErr)
                MESSAGEBOX( [The message was sent successfully], 64, [Notice])
        ELSE
                MESSAGEBOX( lcErr, 16 , [Error])
        ENDIF

ENDTRY


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to