#1  
Old 3rd November 2011, 20:31
countrydj countrydj is offline
Junior Member
 
Join Date: Jun 2009
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Default Problem with PHP mail()

Hi Guys...

I have a problem that I just done understand.
This is the code that I am using:
Code:
	# SEND EMAIL

//	$to      = 'ann@in-uk.co.uk';
	$to      = 'dave@swarbrick-racing.co.uk';
	$subject = "Web site Enquiry";

	$headers = "From: $email ($name)\r\n";
	$headers .= "Bcc: jc@ukzone.com\r\n";
   	$headers .="Reply-To: $name <$email>\r\n";
   	$headers .="X-Mailer: PHP/ . phpversion()";

	$messages = "Message from:  $name ($email) on $date_time\n\n";
	$messages .= "-----------------------------------------------------------------------------------------------------------------------------------\n\n";
	$messages .= "Remote IP: $remote_ip\n";
	$messages .= "Referer: $referer\n\n";
	$messages .= "Name: $name\n\n";
	$messages .= "Country: $country\n\n";
	$messages .= "Selection: $selection\n\n";
	$messages .= "Message:\n";
	$messages .= "$message\n\n";
	$messages .= "-----------------------------------------------------------------------------------------------------------------------------------\n\n";
	$messages .= "HTTP_USER_AGENT: $client\n\n";
mail($to, $subject, $messages, $headers);
The problem that I have is that the code will send Bcc when I have the main recipient as:
Code:
$to      = 'dave@swarbrick-racing.co.uk';
but it will NOT send Bcc when the main recipient is:
Code:
$to      = 'ann@in-uk.co.uk';
Has anybody got any ideas why this should happen ???

Any suggestions will be welcome.

John C
Reply With Quote
Sponsored Links
  #2  
Old 4th November 2011, 10:31
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Do jc@ukzone.com and ann@in-uk.co.uk point to the same mailbox?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 4th November 2011, 12:15
countrydj countrydj is offline
Junior Member
 
Join Date: Jun 2009
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Falko...
Thanks for taking the time to try and help me.
Quote:
Do jc@ukzone.com and ann@in-uk.co.uk point to the same mailbox?
Yes, as it happens, they do.

However, this issue came to light when I was setting up another contact form for a different site. This is what I was setting up and couldn't get it to work:
PHP Code:
    # SEND EMAIL

    
$to      'ken@ckmarquees.co.uk';
    
$subject "Web site Enquiry";

    
$headers "From: $email ($name)\r\n";
    
$headers .= "Bcc: jc@ukzone.com\r\n";
       
$headers .="Reply-To: $name <$email>\r\n";
       
$headers .="X-Mailer: PHP/ . phpversion()"
ken@ckmarquees.co.uk and jc@ukzone.com do NOT share the same mailbox.

When I couldn't get this to work, I went to a script that I knew was working to try and identify the problem.

HOWEVER....
I tested again with an email address that I control and doesn't go to the same mailbox.

You were RIGHT...

That worked.

I then went back to the original problem (the code above) and it was working !!!

The only thing that I did was to turn off my computer (not server) last night and switch it on agan this morning.

???????????????????????

Thanks very much for your help...

John C
Reply With Quote
  #4  
Old 24th November 2011, 09:57
nashj99 nashj99 is offline
Junior Member
 
Join Date: Nov 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey all,

the phpmail function is used in the php scripting for sending mail from the php code . the actuall script is
<?php
$to = "somebody@example.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";

mail($to,$subject,$txt,$headers);
?>

is this a complete code to send mail from the script ?
Reply With Quote
  #5  
Old 25th November 2011, 17:55
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Yes, that should work.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Email Working ISPConfig3 Squirrelmail and Courier etc Ian Wilson Installation/Configuration 17 19th June 2013 22:58
Cron errors guimnk General 1 5th April 2011 09:20
Problem with services!! banzaiwebstudio.com Installation/Configuration 7 19th May 2010 21:13
just the last step...and it works. Postfix...need help config. ubuntusr Installation/Configuration 1 5th January 2009 09:50
Can not recieve mail with de virtual mail adress Mounir Installation/Configuration 9 24th July 2006 23:16


All times are GMT +2. The time now is 09:22.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.