Personalized Email Script

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

    Personalized Email Script

    I'm posting in desperation and hopes that someone has a script that will
    achieve these objectives:

    1. Web interface using forms collects Name, Address, Email Address.
    2. Web interface sends this info to a PHP script.
    3. PHP script has pre-entered text.
    4. Name, Address, and Email Address are appended to the END of the
    outgoing email message.
    5. The outgoing email address shows the "From" as the Email Address.
    6. THE PROBLEM: The PHP script has 55 pre-entered email addresses. The
    script sends the email individually to each of the 55 people pre-entered
    such that the To: line contains only one email address.

    Help! Anybody got such a script? I tried writing one, but I'm not even a
    Newbie yet, so I did not have any success.

    I tried using MailMan for the distribution, which works fairly well, but
    the To: line includes some garbage, like "Sent by <listname> on behalf
    of <originalsender >".
  • Geoff Berrow

    #2
    Re: Personalized Email Script

    I noticed that Message-ID:
    <d546d60edbc916 18c2ada7c86135c 221@news.terane ws.com> from mcp6453
    contained the following:
    [color=blue]
    >6. THE PROBLEM: The PHP script has 55 pre-entered email addresses. The
    >script sends the email individually to each of the 55 people pre-entered
    >such that the To: line contains only one email address.
    >
    >Help! Anybody got such a script? I tried writing one, but I'm not even a
    >Newbie yet, so I did not have any success.[/color]

    Try again, it's pretty easy.

    //Put your addresses in an array

    //e.g.

    $addresses=arra y("address1", "address2", "address_n" )

    //Then set up subject

    $subject ="some subject";

    //The message...

    $message="some message \n";

    //Add the POSTed stuff

    $message.=$_POS T['name']."\n";
    $message.=$_POS T['address']."\n";
    $message.=$_POS T['email']."\n";

    Then loop through them to send the mails

    for($i=0;$i<cou nt($addresses); $i++){

    mail($addresses[$i],$subject,$mess age);
    }

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

    Comment

    • Pedro Graca

      #3
      Re: Personalized Email Script

      Geoff Berrow wrote:[color=blue]
      > Then loop through them to send the mails
      >
      > for($i=0;$i<cou nt($addresses); $i++){
      >
      > mail($addresses[$i],$subject,$mess age);
      > }[/color]

      I prefer:

      foreach ($addresses as $addr) {
      mail($addr, $subject, $message);
      }

      :-)

      --
      USENET would be a better place if everybody read: | to email me: use |
      http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
      http://www.netmeister.org/news/learn2quote2.html | header, textonly |
      http://www.expita.com/nomime.html | no attachments. |

      Comment

      • mcp6453

        #4
        Re: Personalized Email Script

        Pedro Graca wrote:[color=blue]
        >
        > Geoff Berrow wrote:[color=green]
        > > Then loop through them to send the mails
        > >
        > > for($i=0;$i<cou nt($addresses); $i++){
        > >
        > > mail($addresses[$i],$subject,$mess age);
        > > }[/color]
        >
        > I prefer:
        >
        > foreach ($addresses as $addr) {
        > mail($addr, $subject, $message);
        > }[/color]


        Thanks to both of you for posting this solution. I wondered about using
        foreach!

        Comment

        • Brian

          #5
          Re: Personalized Email Script

          mcp6453 wrote:
          [color=blue]
          > 6. THE PROBLEM: The PHP script has 55 pre-entered email addresses.
          > The script sends the email individually to each of the 55 people
          > pre-entered such that the To: line contains only one email address.
          >[/color]
          Use BCC: instead of To:

          --
          Brian (remove ".invalid" to email me)

          Comment

          • Michael Austin

            #6
            Re: Personalized Email Script

            Brian wrote:
            [color=blue]
            > mcp6453 wrote:
            >[color=green]
            >> 6. THE PROBLEM: The PHP script has 55 pre-entered email addresses.
            >> The script sends the email individually to each of the 55 people
            >> pre-entered such that the To: line contains only one email address.
            >>[/color]
            > Use BCC: instead of To:
            >[/color]

            The use of BCC only may result in your email being tossed as a number of
            companies do not allow BCC-only (nothing in the To: field) to be
            processed as it is generally considered SPAM.

            Michael Austin.

            Comment

            • Brian

              #7
              Re: Personalized Email Script

              Michael Austin wrote:[color=blue]
              > Brian wrote:
              >[color=green]
              >> Use BCC: instead of To:[/color]
              >
              > The use of BCC only may result in your email being tossed as a
              > number of companies do not allow BCC-only (nothing in the To:
              > field) to be processed as it is generally considered SPAM.[/color]

              I didn't know that. I suppose you could put a dummy item in the to:
              field. That's the way Pine worked, IIRC. I mailed playlists to record
              labels using e.g.,
              To: Program Playlists
              Bcc: label@example.c om

              --
              Brian (remove ".invalid" to email me)

              Comment

              • Larry Jaques

                #8
                Re: Personalized Email Script

                On Wed, 07 Jul 2004 01:05:19 GMT, Michael Austin
                <maustin@firstd basource.com> calmly ranted:
                [color=blue]
                >Brian wrote:
                >[color=green]
                >> mcp6453 wrote:
                >>[color=darkred]
                >>> 6. THE PROBLEM: The PHP script has 55 pre-entered email addresses.
                >>> The script sends the email individually to each of the 55 people
                >>> pre-entered such that the To: line contains only one email address.
                >>>[/color]
                >> Use BCC: instead of To:
                >>[/color]
                >
                >The use of BCC only may result in your email being tossed as a number of
                > companies do not allow BCC-only (nothing in the To: field) to be
                >processed as it is generally considered SPAM.[/color]

                Can't you use your own address (or a default address) in the
                To: field and then send the rest to BCC:?


                ----------------------------------------------
                Never attempt to traverse a chasm in two leaps
                http://www.diversify.com Comprehensive Website Design
                =============== =============== =============== ==============

                Comment

                • Gary L. Burnore

                  #9
                  Re: Personalized Email Script

                  On Tue, 06 Jul 2004 20:56:41 -0700, Larry Jaques
                  <novalidaddress @di\/ersify.com> wrote:
                  [color=blue]
                  >On Wed, 07 Jul 2004 01:05:19 GMT, Michael Austin
                  ><maustin@first dbasource.com> calmly ranted:
                  >[color=green]
                  >>Brian wrote:
                  >>[color=darkred]
                  >>> mcp6453 wrote:
                  >>>
                  >>>> 6. THE PROBLEM: The PHP script has 55 pre-entered email addresses.
                  >>>> The script sends the email individually to each of the 55 people
                  >>>> pre-entered such that the To: line contains only one email address.
                  >>>>
                  >>> Use BCC: instead of To:
                  >>>[/color]
                  >>
                  >>The use of BCC only may result in your email being tossed as a number of
                  >> companies do not allow BCC-only (nothing in the To: field) to be
                  >>processed as it is generally considered SPAM.[/color]
                  >
                  >Can't you use your own address (or a default address) in the
                  >To: field and then send the rest to BCC:?[/color]

                  He could use php to send one message to a Majordomo Listserv and have
                  the listserve expand the names. Each user would get their own and the
                  majordomo list would be easily updatable.


                  --
                  gburnore@databa six dot com
                  ---------------------------------------------------------------------------
                  How you look depends on where you go.
                  ---------------------------------------------------------------------------
                  Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
                  | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
                  DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
                  | ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
                  Black Helicopter Repair Svcs Division | Official Proof of Purchase
                  =============== =============== =============== =============== ===============
                  Want one? GET one! http://www.databasix.com
                  =============== =============== =============== =============== ===============

                  Comment

                  • Manuel Lemos

                    #10
                    Re: Personalized Email Script

                    Hello,

                    On 07/07/2004 12:32 AM, Brian wrote:[color=blue][color=green]
                    >> The use of BCC only may result in your email being tossed as a
                    >> number of companies do not allow BCC-only (nothing in the To:
                    >> field) to be processed as it is generally considered SPAM.[/color]
                    >
                    >
                    > I didn't know that. I suppose you could put a dummy item in the to:
                    > field. That's the way Pine worked, IIRC. I mailed playlists to record
                    > labels using e.g.,
                    > To: Program Playlists
                    > Bcc: label@example.c om[/color]

                    That is not the problem. The problem is that the messages are discarded
                    if the actual recipient that you set in Bcc: is not in a visible header
                    (To: or Cc:) denoting that the message was not really for the recipient
                    but rather some bulk mailing.

                    Hotmail started classifying messages like this as spam, depending on the
                    filtering level, which is bad because it affects messages sent to
                    mailing lists.

                    If you really want to reach Hotmail users and of other systems that make
                    this kind of filtering you have no choice than sending separate
                    messages to each of them.

                    Since you do not want to personalize the messages, you may want to try
                    this class that can compose and send messages. It comes with a feature
                    of caching messages between deliveries to avoid regenerating the message
                    body while you can still change the To: header for each recipient.



                    Bulk mailing is an heavy task but at least you can save some time
                    optimizing some heavy parts.

                    There are other types of optimizitions but those depend on the mail
                    system that you use. Just mail me privately so I can tell you more on
                    this without having you to disclose unnecessary details in public.

                    --

                    Regards,
                    Manuel Lemos

                    PHP Classes - Free ready to use OOP components written in PHP
                    Free PHP Classes and Objects 2026 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials


                    PHP Reviews - Reviews of PHP books and other products


                    Metastorage - Data object relational mapping layer generator

                    Comment

                    Working...