views:

1160

answers:

6

Hi,

I am using XAMPP on a localhost windows VISTA m/c...using gmail as smpt server

I am trying to send an email using simple PHP script

here is the configuration details on sendmail.ini(I have the sendmail.exe and the other 2 dll in that directory)

smtp_server=smtp.gmail.com ; smtp port (normally 25)

smtp_port=465

; the default domain for this server will be read from the registry ; this will be appended to email addresses when one isn't provided ; if you want to override the value in the registry, uncomment and modify

default_domain=localhost

; log smtp errors to error.log (defaults to same directory as sendmail.exe) ; uncomment to enable logging

error_logfile=error.log

; create debug log as debug.log (defaults to same directory as sendmail.exe) ; uncomment to enable debugging

debug_logfile=debug.log

; if your smtp server requires authentication, modify the following two lines

auth_username=xxxxxxx auth_password=xxxxxx

hostname=localhost

and I have changed the php.ini

[mail function] ; For Win32 only. ;SMTP = localhost ;smtp_port = 25

; For Win32 only. ;sendmail_from = xxxxx

; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = "C:\xampp\sendmail\sendmail.exe -t"

and Once I call the script it goes into waiting...for localhost... here is the debug.log...

09/05/02 17:34:41 ** --- MESSAGE BEGIN --- 09/05/02 17:34:41 ** To: [email protected] 09/05/02 17:34:41 ** Subject: Form Submission Results 09/05/02 17:34:41 ** From: My Web Site 09/05/02 17:34:41 ** Reply-To: [email protected] 09/05/02 17:34:41 ** 09/05/02 17:34:41 ** Name: xxx 09/05/02 17:34:41 ** E-Mail: [email protected] 09/05/02 17:34:41 ** Message: hey test message 09/05/02 17:34:41 ** 09/05/02 17:34:41 ** 09/05/02 17:34:41 ** --- MESSAGE END --- 09/05/02 17:34:41 ** Connecting to smtp.gmail.com:465 09/05/02 17:34:41 ** Connected.

I am new to PHP and would like to know if there is a better way to do mail...I am not in for HTML/multipart mails with attachment now... Also i should be able to test in localhost without SMTP server installed . I would like to use GMAIL for now testing. THnks

A: 

GMAIL needs SSL afaik.

Of free (and probably "good") php mail libraries i know Zend_Mail and Swiftmailer.

Karsten
A: 

so Can I use the Swiftmailer to use gmail smtp server to send the email.

coool
A: 

You should also check with your ISP. A lot of them block port 25 to prevent spam.

David Weitz
A: 

I strongly suggest you use a library e.g. PHPMailer. Here is their gmail example.

Another good library (which I haven't used) is SwiftMailer. Here is their gmail example.

daremon
A: 

Here is the key...I will be doing this from my Local laptop...i am still learning php...So will the phpmailer work on windows vista m/c trying to use a hotmail/gmail as the smtp server... THNks YOU GUYS....

coool
A: 

YOU GUYS rock...PHP Mailer is good(DUmmy's perfect partner)...WILL CHECK IF I HAVE more question... THNKS

coool