Results 1 to 6 of 6

Thread: Problem with sending mail via smtp.gmail ( php )

  1. #1
    Join Date
    Feb 2011
    Beans
    3

    Problem with sending mail via smtp.gmail ( php )

    HI ,
    I want to send mails via gmail with php. I need to know how to configure main.cf, php.ini, postfix,smtp... and all what is necessary. I tried a lot but no results.
    Please try explain it me throught easy way. Or give me tutorials for it.
    Thanks a lot.

  2. #2
    Join Date
    Sep 2007
    Location
    Rivendell
    Beans
    487
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Problem with sending mail via smtp.gmail ( php )

    True warriors don't follow paths - they make them.
    It's not their desire, it's their nature.

  3. #3
    Join Date
    Jun 2010
    Location
    Highlands, Scotland
    Beans
    153
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Problem with sending mail via smtp.gmail ( php )

    Code:
    		
    $mail_host = "mail.yoursite.com";
    $mail_port = "25";
    $mail_addy = "me@mysite.com";
    ini_set("SMTP", $mail_host);
    ini_set("SMTP_PORT", $mail_port);
    ini_set("sendmail_from", $mail_addy);
    add that to you php file it works on my sites

  4. #4
    Join Date
    Feb 2011
    Beans
    3

    Re: Problem with sending mail via smtp.gmail ( php )

    Quote Originally Posted by wiggly81 View Post
    Code:
            
    $mail_host = "mail.yoursite.com";
    $mail_port = "25";
    $mail_addy = "me@mysite.com";
    ini_set("SMTP", $mail_host);
    ini_set("SMTP_PORT", $mail_port);
    ini_set("sendmail_from", $mail_addy);
    add that to you php file it works on my sites
    It is not a configuration of Postfix, or main.cf,....I think at first a have to configurate..

    now in my mail.log reloads every minute this error:

    Feb 28 17:20:16 Andrej postfix/qmgr[4299]: fatal: dict_open: unsupported dictionary type: ssl: Is the postfix-ssl package installed?
    Feb 28 17:20:16 Andrej postfix/pickup[4298]: fatal: dict_open: unsupported dictionary type: ssl: Is the postfix-ssl package installed?
    Feb 28 17:20:17 Andrej postfix/master[2943]: warning: process /usr/lib/postfix/qmgr pid 4299 exit status 1
    Feb 28 17:20:17 Andrej postfix/master[2943]: warning: /usr/lib/postfix/qmgr: bad command startup -- throttling
    Feb 28 17:20:17 Andrej postfix/master[2943]: warning: process /usr/lib/postfix/pickup pid 4298 exit status 1
    Feb 28 17:20:17 Andrej postfix/master[2943]: warning: /usr/lib/postfix/pickup: bad command startup -- throttling


    Can you help me ?

  5. #5
    Join Date
    Feb 2011
    Beans
    3

    Re: Problem with sending mail via smtp.gmail ( php )

    Quote Originally Posted by LoneWolfJack View Post
    I do not need script to send mail....I think at first I need configurate smtp or postfix or....I do not know...

    I write below my errors in mail.log.....can you help me ?

  6. #6
    Join Date
    Sep 2007
    Location
    Rivendell
    Beans
    487
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Problem with sending mail via smtp.gmail ( php )

    as the error message states, you are probably trying to send mail from a script that is being run in a SSL context. you can't do that without first installing postfix-ssl.

    that aside, you can only get away with abusing mail() by forcing it to send mail through a SMTP server as long as the server doesn't require authentication.

    if it does, you will have to use one of the various PHP sendmail classes or implement your own. Craig's blog post provides the basics for doing that.

    /edit
    shouldn't a mod move this thing to programming talk?
    True warriors don't follow paths - they make them.
    It's not their desire, it's their nature.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •