Web Analytics Made Easy -
StatCounter mail() problem and headers - CodingForum

Announcement

Collapse
No announcement yet.

mail() problem and headers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mail() problem and headers

    PHP Code:
    $headers "Wrom: ALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJS";
        
    $headers "Reply-To: E-hosti Customer\n" 
        
    $headers "X-Mailer: PHP/" phpversion() . "\n" 
    That don't work for me

    From : <[email protected]>

    and

    PHP Code:
    mail(sales@e-hosti.com$email$body$headers); 


    that don't send two emails at the same time, [email protected] can send but not $email (person's email). i tried to swap them but still only one send email.

    i want both emails send to us and person at the same time.

    I need help with those problems

    Thanks
    http://e-hosti.com :: Our low cost web hosting packages... 99% Uptime... 30 Day Money Back Guarantee...

  • #2
    Try using quotes in your mail function call
    PHP Code:
    mail('[email protected], $email''$body''$headers'); 
    TopHostingDeals - The best place for the best deals!
    "It's nice to be important, but it's more important to be nice!"

    Comment


    • #3
      Subject: $body

      The message: $headers

      Why is that? i don't think quotes needed.
      http://e-hosti.com :: Our low cost web hosting packages... 99% Uptime... 30 Day Money Back Guarantee...

      Comment


      • #4
        You need to use quotes to tell PHP that the details in the first quoted area are the email addresses it needs to send to seperated with a comma.

        Out of curiousity, what is the subject of the emails you receive at [email protected]?
        TopHostingDeals - The best place for the best deals!
        "It's nice to be important, but it's more important to be nice!"

        Comment


        • #5
          ok, i use this

          mail("[email protected], $email","$subject","$body","From: E-hosti Team [email protected]");

          its working to email us but

          From : <[email protected], [email protected], [email protected]> // INCORRECT
          Sent : Monday, 1 March 2004 6:35:38 PM
          To : [email protected], [email protected] // correct
          Subject : dd // correct


          why do i have twice emails in "From"?


          thanks keith
          http://e-hosti.com :: Our low cost web hosting packages... 99% Uptime... 30 Day Money Back Guarantee...

          Comment


          • #6
            That shouldn't work, you should've got a parse error
            PHP Code:

            $to 
            "[email protected], ".$email;
            $subject "whatever";
            $message "whatever";
            $headers "From: E-Hosti Team <[email protected]>";

            mail($to,$subject,$message,$headers); 

            Comment


            • #7
              Re: mail() problem and headers

              Originally posted by fr0stx
              PHP Code:
              $headers "Wrom: ALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJS";
                  
              $headers "Reply-To: E-hosti Customer\n" 
                  
              $headers "X-Mailer: PHP/" phpversion() . "\n" 
              Shouldn't it be
              PHP Code:
                  $headers "Reply-To: E-hosti Customer\n" 
                  
              $headers .= "X-Mailer: PHP/" phpversion() . "\n" 
              ...adding the "." in the second declaration.

              Comment

              Working...
              X