#1
  1. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4124

    Sending email from PHP....telnet style


    I have my own dedicated SMTP server (running postfix).

    At the moment I connect to it using PHPMailer to send bulk marketing emails, but I'm not getting the feedback I require from PHPMailer

    I've considered switching to swiftmailer as this seems more comprehensive and can capture failed emails...but it does this by address only.

    When I telnet to my server I can issue HELO, RCPT TO, MAIL FROM and DATA commands.

    I also get feedback - I get the message queue id from postfix. I can use this ID to later interrogate the mail logs for deferals, bounces, deliveries etc

    What I can't seem to do is replicate the process from a PHP script.

    I have tried to use proc_open("telnet <ip> 25",$desc,$pipes) and then reading from and writing to the pipes. I've also tried to proc_open /bin/bash and then issue the telnet cmd on the input stream.... none of this seems to work. I can open the streams but cannot set them to be non-blocking so attempting to read from them (which is important) hangs forever.

    Am I even going about this in the right way?

    I considered using fsockopen...but wasn't sure how to do the two way communication (ie continuing to issue commands and read the feedback)

    Any ideas
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  2. #2
  3. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,556
    Rep Power
    2338
    This might be helpful: Send Emails Using PHP/SMTP Direct
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  4. #3
  5. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4124
    Ah, so multiple fputs after opening the socket...didn't know I could do that!
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]

IMN logo majestic logo threadwatch logo seochat tools logo