Results 1 to 4 of 4

Thread: php, mail, cc not really working

  1. #1

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    php, mail, cc not really working

    Hi,
    The following code run without errors. I get the mail ,and also it show the mail was cc'ed to who it should.
    but the mail never arrive at the cc'ed address..tired of this one now!

    Code:
    function send_site_message ($name, $country, $email, $subject, $message, $selfcc)  {
    		$headers  = 'MIME-Version: 1.0' . "\r\n";
    		$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    		if ($selfcc)	
    			$headers .= "cc:".$name."<".$email.">";
    		$message = "
    			<html>
    				<head> ... and rest of html...
    			</html>
    		";
    		$success = mail(SMTP_USER, $subject, $message, $headers, "-f".$email);

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: php, mail, cc not really working

    Try

    "cc:".$email;

    ; so don't mention the name.

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: php, mail, cc not really working

    I do believe the correct format is "Cc: [email protected]" note the space and capitalisation of the first C. Also, the MTA as per RFC 1123 is not obliged to act upon cc and bcc headers so you should use a comma separated list of addresses in the $to argument of the function.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: php, mail, cc not really working

    thanks both of you.

    i followed both of your's advice and seems to work..intermittently. and my html mail seems not to work always..aiya

    try it yourself here (excuse the mess..just try to get things working before putting on the makeup)

Posting Permissions

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



Click Here to Expand Forum to Full Width