tSmtp() with gmail

Post Reply
Willy
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

tSmtp() with gmail

Post by Willy »

Hello,

I use the following code

Code: Select all

function SendMail()
   local oOutMail, cIP


   WSAStartup()
   oOutMail := TSmtp():New( cIP := GetHostByName( "smtp.gmail.com",465) )
   MsgInfo( cIP )

   oOutMail:bConnecting = { ||nil }
   oOutMail:bConnected  = { ||nil  }
   oOutMail:bDone       = { || MsgInfo( "Message sent successfully" ) }

   oOutMail:SendMail( "hermanswilly@gmail.com",;     // From
                      { "hermanswilly@gmail.com" },; // To
                      "Test2",;              // Msg Text
                      "Test 2",; // Subject
                      { } )  // attached files

return nil
 
It works fine with my standard provider.

When I want to use gmail port 465 or port 587 it does not work.

Does someone have an idea.

Thanks

Willy
SylRob
Posts: 15
Joined: Thu Nov 01, 2007 4:54 pm

Re: tSmtp() with gmail

Post by SylRob »

Willy,

To use SMTP Gmail you must been authenticated !. I'm not using Fivewin nor Xharbour but see how you can use SMTP authentication with Fivewin !

Quote from GMAIL setup instruction
Please note that if your client does not support SMTP authentication, you won't be able to send mail through your client using your Gmail address.

?End quote

Best,

Sylvain
Sylvain Robert
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: tSmtp() with gmail

Post by James Bott »

Willy
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Re: tSmtp() with gmail

Post by Willy »

Thanks,

This works properly.

Now the pop3 server and all mail can be managed from within FiveWin.

Greetings

Willy
Post Reply