what is wrong with this mail script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yoelgold@yahoo.com

    what is wrong with this mail script

    $msubject = "Price Change";
    $tomail = "yoelg...@yahoo .com";
    $mfrom = "From: Baltimore Trails <i...@baltimore trails.com>\r\n ";
    $mbody = "text....asdfas dfasdfasdfasdfa ­sdf";
    $bcchead1 = "Bcc: i...@baltimoret rails.com\r\n";
    $bcchead2 = "Bcc: yoelg...@baltim oretrails.com\r \n";
    $header = "$mfrom $bcchead1 $bcchead2";
    mail($tomail, $msubject, $mbody, $header);
    -------------------------------------------------------

    this is what yoelg...@baltim oretrails.com email looks like:
    the From field in MS outlook = "Baltimore Trails Bcc:
    yoelg...@baltim oretrails.com"
    and the To: field = "yoelg...@yahoo .com"


    how do I make that the email in the bcc field should not see the To
    field, they should see there email in the to field?
    and why is the from field the way it is?


    As far as the email for yoelg...@yahoo. com everything seems to be fine
    with that

  • Ken Robinson

    #2
    Re: what is wrong with this mail script

    "yoelgold@yahoo .com" <yoelgold@yahoo .com> wrote in
    news:1125523135 .041204.139310@ g14g2000cwa.goo glegroups.com (in part):
    [color=blue]
    > $msubject = "Price Change";
    > $tomail = "yoelg...@yahoo .com";
    > $mfrom = "From: Baltimore Trails <i...@baltimore trails.com>\r\n ";
    > $mbody = "text....asdfas dfasdfasdfasdfa ­sdf";
    > $bcchead1 = "Bcc: i...@baltimoret rails.com\r\n";
    > $bcchead2 = "Bcc: yoelg...@baltim oretrails.com\r \n";
    > $header = "$mfrom $bcchead1 $bcchead2";
    > mail($tomail, $msubject, $mbody, $header);
    > -------------------------------------------------------
    >
    > this is what yoelg...@baltim oretrails.com email looks like:
    > the From field in MS outlook = "Baltimore Trails Bcc:
    > yoelg...@baltim oretrails.com"
    > and the To: field = "yoelg...@yahoo .com"[/color]

    Try this instead:

    msubject = 'Price Change';
    $tomail = 'yoelg...@yahoo .com';
    $mfrom = 'From: Baltimore Trails <i...@baltimore trails.com>'."\ r\n";
    $mbody = "text....asdfas dfasdfasdfasdfa ­sdf";
    $header = $mfrom;
    $header .= 'Bcc: i...@baltimoret rails.com';
    $header .= ',yoelg...@balt imoretrails.com '."\r\n";

    Your original way of creating the header put spaces in the string which
    probably messed up the email headers. Also, the addresses in the BCC
    header should be separated with commas.

    Ken

    Comment

    • Alvaro G Vicario

      #3
      Re: what is wrong with this mail script

      *** yoelgold@yahoo. com wrote/escribió (31 Aug 2005 14:18:55 -0700):[color=blue]
      > $mfrom = "From: Baltimore Trails <i...@baltimore trails.com>\r\n ";
      > $mbody = "text....asdfas dfasdfasdfasdfa ­sdf";
      > $bcchead1 = "Bcc: i...@baltimoret rails.com\r\n";
      > $bcchead2 = "Bcc: yoelg...@baltim oretrails.com\r \n";
      > $header = "$mfrom $bcchead1 $bcchead2";[/color]

      This code creates these headers:

      From: Baltimore Trails <i...@baltimore trails.com>
      Bcc: i...@baltimoret rails.com
      Bcc: yoelg...@baltim oretrails.com

      If first char in line is a white space, mail server will think it's not a
      new header but the previous one continued. Remove unwanted spaces.


      --
      -- Álvaro G. Vicario - Burgos, Spain
      -- http://bits.demogracia.com - Mi sitio sobre programación web
      -- Don't e-mail me your questions, post them to the group
      --

      Comment

      • yoelgold@yahoo.com

        #4
        Re: what is wrong with this mail script

        thank you Ken and Alvaro for your replys

        another question. when i ran the script by typing the php file address
        in to Internet Explorer, it only sent out like 56 out of about 68
        emails. it came back with a 30 second time out error. sorry i dont
        remember the exact error message. any idea what and how to correct this

        thank you

        Comment

        • Andy Hassall

          #5
          Re: what is wrong with this mail script

          On 13 Sep 2005 14:15:08 -0700, "yoelgold@yahoo .com" <yoelgold@yahoo .com> wrote:
          [color=blue]
          >another question. when i ran the script by typing the php file address
          >in to Internet Explorer, it only sent out like 56 out of about 68
          >emails. it came back with a 30 second time out error. sorry i dont
          >remember the exact error message. any idea what and how to correct this[/color]

          Sent less in a batch, tune your mail server, or increase the PHP execution
          time limit http://uk2.php.net/set_time_limit

          --
          Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
          http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

          Comment

          Working...