SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I need some help with my Mail script. I've found out that local addresses most fo time time do not print the headers in the correct place:

    Subject: Here
    From: Here
    etc...
    ---------------------------------
    Message here

    Like a normal email, except with my script, for some strange reason, on some accounts I get:
    Code:
    Subject: test
    From: webmaster@codingclick.com
    Reply-To: webmaster@codingclick.com
    Return-Path: <webmaster@codingclick.com>
    Message-Id: <E14rfsI-0003xv-00@host3.hrwebservices.net>
    Sender: Nobody <nobody@host3.hrwebservices.net>
    Date: Mon, 23 Apr 2001 08:55:30 -0400
    
    Message Here
    All that is displayed in the message body and the other field are all blank. Except the to field. Does anyone have a solution? I've used other scripts and they work perfectly fine but this is really confusing me. I've tried comparing other script seeing what is happening but I can find a solution.

    If you download my script: http://scripts.codingclick.com/MyMail then the file send.php is the one in question as it sends the message, its to long to post here.

    EDIT: The header are:
    Code:
    $headers = "From: $fromemail\n" .
                "Reply-To: $fromemail\n" .
                "Return-Path: <$fromemail>\n";
    and the mail is:
    Code:
    mail($address, $subject, $text, $headers);
    End EDIT
    THanks for your help,
    Peter
    Last edited by petesmc; Apr 23, 2001 at 06:10.

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try getting rid of the \n after $fromemail

  3. #3
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That just does this:

    Code:
    Subject: test
    From: webmaster@codingclick.comReply-To: webmaster@codingclick.com
    Message-Id: <E14rgG4-0004sR-00@host3.hrwebservices.net>
    Sender: Nobody <nobody@host3.hrwebservices.net>
    Date: Mon, 23 Apr 2001 09:20:04 -0400
    
    
    text
    -Peter

  4. #4
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i meant the one after "Return-Path: <$fromemail>\n";


    .. it is very strange that even the subject does not end up in the subject field. $address is properly formatted with no problems there i assume? what email readers is the happening on or is it all? what happens when you try and view the message source, for example in outlook express, do the lines match up or is subject line in oe empty?

    arr.. had a thought.

    try mail differently like:

    mail("chris@thepadfields.com", "$user_subject", "$message", "$mailheaders");

  5. #5
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, none of them work...

    Pete

  6. #6
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mail("webmaster@codingclick.com", "$user_subject", "$message", "$mailheaders");

    That worked without the quotes on the other things... sending to a certain emails..

    Any ideas>

    Peter

  7. #7
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got it working.

    For some reason, my box that inserts emails was exploding on:

    explode("\n", $emails);

    Except it shuold have been:

    explode("\r\n", $emails);

    Thus I had to add:

    $address = str_replace("\r", $address);

    Befroe the mail was sent so it is very consuming. However how would you create a script that would:

    Grab every single email from the database
    Get rid of the \r then insert them back in.

    This is so that i can remove the srt_replace in the while in the actual script as it slows it down considerably for a large list.

    Thanks
    Peter


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •