By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 2,021 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

Is it possible to send mail through authenticated SMTP?

P: n/a
Currently, I run postfix on my own server to send message from my site
(password requests, account activation notices and other messages).
I have phpMailer on the server and all the messages (currently about
1000 messages are sent daily) are sent by SMTP through postfix.

I'm contemplating moving this particular site's email to Gmail.

Is it possible to send mail through Gmail's servers with authentication
and everything?

Jun 2 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
John Drako wrote:
Currently, I run postfix on my own server to send message from my site
(password requests, account activation notices and other messages).
I have phpMailer on the server and all the messages (currently about
1000 messages are sent daily) are sent by SMTP through postfix.

I'm contemplating moving this particular site's email to Gmail.

Is it possible to send mail through Gmail's servers with authentication
and everything?
Hi John,
According to
http://lifehacker.com/software/email...ver-111166.php
gmail uses smtp over tls, with smtp authentication.

I would use pear mail, an basic guide is available here
http://www.phpmaniac.net/wiki/index.php/Pear_Mail but is does not cover
the authentication, or the use of smtp (as opposed to the mail() function).

iirc if you use smtp auth, the connection is automatically TLS.

You would want to use the smtp factory, with the following params:

$smtp_params["host"] = "smtp.gamil.com";
$smtp_params["port"] = "25";
$smtp_params["auth"] = true;
$smtp_params["username"] = "gm********@gmail.com";
$smtp_params["password"] = "gmail_password";

$mail_object =& Mail::factory("smtp", $smtp_params);

--
Hope this helps, Cheers
Leigh Finch
www.phpmaniac.net
Jun 2 '08 #2

P: n/a
Hello,

on 05/27/2008 12:54 PM John Drako said the following:
Currently, I run postfix on my own server to send message from my site
(password requests, account activation notices and other messages).
I have phpMailer on the server and all the messages (currently about
1000 messages are sent daily) are sent by SMTP through postfix.

I'm contemplating moving this particular site's email to Gmail.

Is it possible to send mail through Gmail's servers with authentication
and everything?

Sure. You may want to try this MIME message class that comes with a
sub-class specialized in SMTP deliveries that supports authentication
and TLS secure connections like Gmail requires.

http://www.phpclasses.org/mimeparser

You also need to use together this SMTP protocol class:

http://www.phpclasses.org/smtpclass

and this SASL class for authentication:

http://www.phpclasses.org/sasl
--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Jun 2 '08 #3

P: n/a
Greetings, John Drako.
In reply to Your message dated Tuesday, May 27, 2008, 19:54:06,
Currently, I run postfix on my own server to send message from my site
(password requests, account activation notices and other messages).
I have phpMailer on the server and all the messages (currently about
1000 messages are sent daily) are sent by SMTP through postfix.
I'm contemplating moving this particular site's email to Gmail.
What is the reason for that? May be there are other solutions?
If you need a particular address in "From"/"Reply-To" fields, you can just set
it and use it with your local postfix.
Is it possible to send mail through Gmail's servers with authentication
and everything?
Ask phpMailer documentation. I don't know. I'm using mail() all the time and
it works flawlessly.
--
Sincerely Yours, AnrDaemon <an*******@freemail.ru>

Jun 2 '08 #4

P: n/a
John Drako wrote:
Currently, I run postfix on my own server to send message from my site
(password requests, account activation notices and other messages).
I have phpMailer on the server and all the messages (currently about
1000 messages are sent daily) are sent by SMTP through postfix.

I'm contemplating moving this particular site's email to Gmail.

Is it possible to send mail through Gmail's servers with authentication
and everything?
Either Pear::Mail or phpmailer will do what you want. I happen to
prefer the latter, but that's only personal preference.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 2 '08 #5

P: n/a
Jerry Stuckle wrote:
John Drako wrote:
>Currently, I run postfix on my own server to send message from my site
(password requests, account activation notices and other messages).
I have phpMailer on the server and all the messages (currently about
1000 messages are sent daily) are sent by SMTP through postfix.

I'm contemplating moving this particular site's email to Gmail.

Is it possible to send mail through Gmail's servers with
authentication and everything?

Either Pear::Mail or phpmailer will do what you want. I happen to
prefer the latter, but that's only personal preference.
I've setup a working example using Pear::Mail sending using gmail
available at
http://www.phpmaniac.net/wiki/index....ing_using_SMTP if
you are interested.

--
Cheers,
Leigh Finch
Jun 2 '08 #6

P: n/a
On Tue, 27 May 2008 23:57:59 -0400, Leigh Finch wrote
(in article <zMSdnfC-CLXaRaHVnZ2dnUVZ_uCdnZ2d@internode>):
Jerry Stuckle wrote:
>John Drako wrote:
>>Currently, I run postfix on my own server to send message from my site
(password requests, account activation notices and other messages).
I have phpMailer on the server and all the messages (currently about
1000 messages are sent daily) are sent by SMTP through postfix.

I'm contemplating moving this particular site's email to Gmail.

Is it possible to send mail through Gmail's servers with
authentication and everything?

Either Pear::Mail or phpmailer will do what you want. I happen to
prefer the latter, but that's only personal preference.

I've setup a working example using Pear::Mail sending using gmail
available at
http://www.phpmaniac.net/wiki/index....ing_using_SMTP if
you are interested.

Thanks to everybody for their answers.

I guess I should have looked at phpMailer sooner. I had an old version
on the server. When I checked I found version 2.0 which does exactly
what I need out of the box. Sometime the 'if it ain't broke don't fix
it' thing is not the optimum policy.

Jun 2 '08 #7

P: n/a
It is possible, however they will replace the from: address with the gmail
address associated with the gmail account.

Regards,
Daniel

"John Drako" <jb*******@gmail.removethis.comwrote in message
news:g1*********@news5.newsguy.com...
Currently, I run postfix on my own server to send message from my site
(password requests, account activation notices and other messages).
I have phpMailer on the server and all the messages (currently about
1000 messages are sent daily) are sent by SMTP through postfix.

I'm contemplating moving this particular site's email to Gmail.

Is it possible to send mail through Gmail's servers with authentication
and everything?

Jul 1 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.