Is it possible to send mail through authenticated SMTP?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Drako

    #1

    Is it possible to send mail through authenticated SMTP?

    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?

  • Leigh Finch

    #2
    Re: Is it possible to send mail through authenticated SMTP?

    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

    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"] = "gmail_user@gma il.com";
    $smtp_params["password"] = "gmail_password ";

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

    --
    Hope this helps, Cheers
    Leigh Finch

    Comment

    • Manuel Lemos

      #3
      Re: Is it possible to send mail through authenticated SMTP?

      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/

      Comment

      • AnrDaemon

        #4
        Re: Is it possible to send mail through authenticated SMTP?

        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 <anrdaemon@free mail.ru>

        Comment

        • Jerry Stuckle

          #5
          Re: Is it possible to send mail through authenticated SMTP?

          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.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          • Leigh Finch

            #6
            Re: Is it possible to send mail through authenticated SMTP?

            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
            >authenticati on 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

            Comment

            • John Drako

              #7
              Re: Is it possible to send mail through authenticated SMTP?

              On Tue, 27 May 2008 23:57:59 -0400, Leigh Finch wrote
              (in article <zMSdnfC-CLXaRaHVnZ2dnUV Z_uCdnZ2d@inter node>):
              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
              >>authenticatio n 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.

              Comment

              • Daniel G

                #8
                Re: Is it possible to send mail through authenticated SMTP?

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

                Regards,
                Daniel

                "John Drako" <jbravo556@gmai l.removethis.co mwrote in message
                news:g1haqu024v 1@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?
                >

                Comment

                Working...