incoming emails

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

    incoming emails

    Hi,

    sometimes, when an action is done on my web site, i send an email to another
    application.
    This application send me automatically a confirmation by email with an
    auto-generated number.

    How can i automatically get the email to parse it and save this number in a
    table?

    Do I need a specific mail server that starts a task when it receives an
    email?
    Suppose I install this mail server, how can I communicate the email content
    to a php script (so it can parse the email and save the number in a
    table)???

    Maybe I can't do that with and need to use a perl script?? So the mail
    server run the perl script with the email content??

    Thanks you for your help because i am lost!

    Rodolphe.



  • Andy Jeffries

    #2
    Re: incoming emails

    On Fri, 17 Oct 2003 12:34:42 +0200, Rod hammered his head on the keyboard
    and somehow managed to type:[color=blue]
    > This application send me automatically a confirmation by email with an
    > auto-generated number.
    >
    > How can i automatically get the email to parse it and save this number in a
    > table?
    >
    > Do I need a specific mail server that starts a task when it receives an
    > email?[/color]

    Most mail servers (under Linux at least) can pass an email to a script.
    [color=blue]
    > Suppose I install this mail server, how can I communicate the email
    > content to a php script (so it can parse the email and save the number
    > in a table)???[/color]

    If you have the command line binary installed just use something like:

    incomingaccount | php /home/someone/php-email.php

    and send email to incomingaccount @yourdomain.com
    [color=blue]
    > Maybe I can't do that with and need to use a perl script?? So the mail
    > server run the perl script with the email content??[/color]

    The same applies, just put the perl script in the mail server setting file
    (e.g. /etc/aliases for sendmail or exim).

    Note Sendmail can be very tricky in where it will run processes from.
    [color=blue]
    > Thanks you for your help because i am lost![/color]

    You may also be able to do this with a .redirect file in the home dir of a
    user who reads this account.


    Or finally, you could put these emails in to a POP3 account and have a
    script run every X minutes from a cron job that downloads the POP3 mail
    (using the IMAP functions in PHP).

    Cheers,


    Andy

    Comment

    • Shawn Wilson

      #3
      Re: incoming emails

      Rod wrote:
      [color=blue]
      > sometimes, when an action is done on my web site, i send an email to another
      > application.
      > This application send me automatically a confirmation by email with an
      > auto-generated number.
      >
      > How can i automatically get the email to parse it and save this number in a
      > table?
      >
      > Do I need a specific mail server that starts a task when it receives an
      > email?
      > Suppose I install this mail server, how can I communicate the email content
      > to a php script (so it can parse the email and save the number in a
      > table)???[/color]

      I'm just playing with this for the first time. The imap functions are working
      well for me so far. I plan to run a cron job every hour or so to check for and
      process new mail.



      Shawn
      --
      Shawn Wilson
      shawn@glassgian t.com

      Comment

      • Rod

        #4
        Re: incoming emails

        Hi all,

        thanks you both for your answers.
        i will have a look to your solutions.
        I think I need time to understand, because i don't exactly know what is
        POP3, IMAP etc etc.

        Thanks you again

        Rodolphe
        "Shawn Wilson" <shawn@glassgia nt.com> wrote in message
        news:3F90062A.9 DB3A014@glassgi ant.com...[color=blue]
        > Rod wrote:
        >[color=green]
        > > sometimes, when an action is done on my web site, i send an email to[/color][/color]
        another[color=blue][color=green]
        > > application.
        > > This application send me automatically a confirmation by email with an
        > > auto-generated number.
        > >
        > > How can i automatically get the email to parse it and save this number[/color][/color]
        in a[color=blue][color=green]
        > > table?
        > >
        > > Do I need a specific mail server that starts a task when it receives an
        > > email?
        > > Suppose I install this mail server, how can I communicate the email[/color][/color]
        content[color=blue][color=green]
        > > to a php script (so it can parse the email and save the number in a
        > > table)???[/color]
        >
        > I'm just playing with this for the first time. The imap functions are[/color]
        working[color=blue]
        > well for me so far. I plan to run a cron job every hour or so to check[/color]
        for and[color=blue]
        > process new mail.
        >
        > http://ca3.php.net/manual/en/ref.imap.php
        >
        > Shawn
        > --
        > Shawn Wilson
        > shawn@glassgian t.com
        > http://www.glassgiant.com[/color]


        Comment

        • Geoff Berrow

          #5
          Re: incoming emails

          I noticed that Message-ID: <bmogfm$3p3$1@h ome.itg.ti.com> from Rod
          contained the following:
          [color=blue]
          >sometimes, when an action is done on my web site, i send an email to another
          >application.
          >This application send me automatically a confirmation by email with an
          >auto-generated number.
          >
          >How can i automatically get the email to parse it and save this number in a
          >table?[/color]

          Could PHP on the website not do it all?

          --
          Geoff Berrow
          It's only Usenet, no one dies.
          My opinions, not the committee's, mine.
          Simple RFDs http://www.ckdog.co.uk/rfdmaker/

          Comment

          Working...