Loading ...
Sorry, an error occurred while loading the content.
 

Re: [nslu2-general] Re: Please, System calls in PHP Apache

Expand Messages
  • Tim Bishop
    I posted last week on this list about a workaround using phpmailer and and an external smtp server. Works for me. Search for Workaround in the subject.
    Message 1 of 9 , Nov 7, 2005
      I posted last week on this list about a workaround using phpmailer and
      and an external smtp server. Works for me. Search for "Workaround" in
      the subject.

      Thanks,
      Tim

      nslu2-general03@... wrote:
      > What about running an SMTP daemon (or using an external one)? That is
      > already written and is all about sending email. If you can open a
      > network socket to it and speak SMTP, you can send email. SMTP isn't
      > very hard. It basically consists of...
      >
      > HELO mydomain.net
      > MAIL FROM: <me@...>
      > RCPT TO: <them@...>
      > DATA
      > From: My Name <me@...>
      > To: Their Name <them@...>
      > Subject: Mail from my PHP script
      >
      > The blank line above seperates the message from the header.
      > This is the message.
      > The message is terminated by a line with just a period in it.
      > .
      > QUIT
      >
      > I'm going off of memory for the above, but it is basically like that.
      > If you don't care about server responses, you can just print that stuff
      > blindly to the server and wait for the connection to close. If there is
      > a PHP module that does the same thing, that would probably be even
      > easier.
      >
      > If you have sendmail, postfix, exim, etc., then you already have an SMTP
      > daemon. I think that if the sender and receiver are local to the
      > domain that the SMTP server serves, you can leave of the
      > @... parts of the addresses, and they will default to the domain
      > of the SMTP server.
      >
      >
      > On Sun, Nov 06, 2005 at 01:21:52PM -0000, nslu2newb wrote:
      >
      >>OK. Thanks for your replies. I too am at a loss at how to fix the
      >>PHP system call problem.
      >>
      >>Similiarly I was trying to use exec, system, passthru, mail etc so I
      >>could automatically have an e-mail sent when an event occurs within in
      >>my PHP script. (My application forces me to use PHP so trying CGI,
      >>etc is out of the question.) Has anyone figured out any work
      >>around to this problem in order to be able to send mail from within an
      >>apache-PHP script?
      >>
      >>I was thinking, for example, of creating some sort of mail daemon that
      >>I had runnning in the background on my NSLU looking for certain files
      >>created by my PHP script...then if it saw them it would read their
      >>header and use this to smptclient mail the content it to its
      >>destination. I have never done something like this before, so was
      >>wondering if I might be missing a more elegant work-around? I have no
      >>problem creating files in PHP...just figuring out a way to have them
      >>automatically e-mailed since all of the commands I can think of in PHP
      >>cause Apache to hang. Thoughts or comments would be much appreciated.
      >>
      >>- NewB
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
    • nslu2newb
      Tim, Workaround using phpmailer worked great for me! It also gave me some functionality I wasn t expecting (e.g. ability to send attachments). I m so happy
      Message 2 of 9 , Nov 8, 2005
        Tim,

        Workaround using phpmailer worked great for me! It also gave me some
        functionality I wasn't expecting (e.g. ability to send attachments).
        I'm so happy right now (after banging my head against the wall for a
        week). I appreciate your and others on the board help. Let me know
        if you'd like any assistance adding the workaround to the wiki if you
        think this will help others. Thanks again!

        - NewB

        --- In nslu2-general@yahoogroups.com, Tim Bishop <geodog@c...> wrote:
        >
        > I posted last week on this list about a workaround using phpmailer and
        > and an external smtp server. Works for me. Search for "Workaround" in
        > the subject.
        >
        > Thanks,
        > Tim
        >
        > nslu2-general03@f... wrote:
        > > What about running an SMTP daemon (or using an external one)? That is
        > > already written and is all about sending email. If you can open a
        > > network socket to it and speak SMTP, you can send email. SMTP isn't
        > > very hard. It basically consists of...
        > >
        > > HELO mydomain.net
        > > MAIL FROM: <me@m...>
        > > RCPT TO: <them@t...>
        > > DATA
        > > From: My Name <me@m...>
        > > To: Their Name <them@t...>
        > > Subject: Mail from my PHP script
        > >
        > > The blank line above seperates the message from the header.
        > > This is the message.
        > > The message is terminated by a line with just a period in it.
        > > .
        > > QUIT
        > >
        > > I'm going off of memory for the above, but it is basically like that.
        > > If you don't care about server responses, you can just print that
        stuff
        > > blindly to the server and wait for the connection to close. If
        there is
        > > a PHP module that does the same thing, that would probably be even
        > > easier.
        > >
        > > If you have sendmail, postfix, exim, etc., then you already have
        an SMTP
        > > daemon. I think that if the sender and receiver are local to the
        > > domain that the SMTP server serves, you can leave of the
        > > @... parts of the addresses, and they will default to the
        domain
        > > of the SMTP server.
        > >
        > >
        > > On Sun, Nov 06, 2005 at 01:21:52PM -0000, nslu2newb wrote:
        > >
        > >>OK. Thanks for your replies. I too am at a loss at how to fix the
        > >>PHP system call problem.
        > >>
        > >>Similiarly I was trying to use exec, system, passthru, mail etc so I
        > >>could automatically have an e-mail sent when an event occurs within in
        > >>my PHP script. (My application forces me to use PHP so trying CGI,
        > >>etc is out of the question.) Has anyone figured out any work
        > >>around to this problem in order to be able to send mail from within an
        > >>apache-PHP script?
        > >>
        > >>I was thinking, for example, of creating some sort of mail daemon that
        > >>I had runnning in the background on my NSLU looking for certain files
        > >>created by my PHP script...then if it saw them it would read their
        > >>header and use this to smptclient mail the content it to its
        > >>destination. I have never done something like this before, so was
        > >>wondering if I might be missing a more elegant work-around? I have no
        > >>problem creating files in PHP...just figuring out a way to have them
        > >>automatically e-mailed since all of the commands I can think of in PHP
        > >>cause Apache to hang. Thoughts or comments would be much appreciated.
        > >>
        > >>- NewB
        > >
        > >
        > >
        > >
        > >
        > > Yahoo! Groups Links
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.