Jump to content

Php Dont Send Meils


Karyna

Recommended Posts

i have a php form that recolect data form users and send some emails... i have no problems with that, but the part is drive me crazy its that as i show in the below example of my code only the last 2 mails are sent.. the first 2 not!!

i been tried no quites, single quotes, double quotes... no use the first 2 mails are not sent.. only the last 2.. whats wrong?? php mail function dont accept variable names in the '$to' parameter??... the echo lines at the end i wroted so i sure the variables have the vaue wich its true... pls.. some one help in this!! :-\ :'(

 

TNX

 

 

.blah

.blah

.

$meil2=$_POST['meil'];

$jobmeil2=$_POST['jobmeil'];

.blah

.

 

mail('$meil2',"VELEC 2012, Resgister succced!","{$datav}","From: [email protected]");

mail('$jobmeil2',"VELEC 2012, Register succed!","{$datav}","From: [email protected]");

mail("[email protected]","VELEC 2012, new customer has register !","$data_cust","From: [email protected]");

mail("[email protected]","VELEC 2012, new customer has register !","$data_cust","From: [email protected]");

 

<?php

echo $meil2;

echo $jobmeil2;

?>

Link to comment
https://forums.phpfreaks.com/topic/271370-php-dont-send-meils/
Share on other sites

"php mail function dont accept variable names in the '$to' parameter??"

 

Yes it does, I use it.

For testing, try hard coding dummy values and/or get rid of one of the parameters. If the simple hard code works it may mean that your format is wrong.

 

mail('$meil2',"VELEC 2012, Resgister succced! $datav","From: [email protected]");

 

or

 

mail('$meil2',"Test Title", "Test Body", "From: [email protected]");

Link to comment
https://forums.phpfreaks.com/topic/271370-php-dont-send-meils/#findComment-1396637
Share on other sites

floridaflatlander: Variables will not be parsed when inside single quotes, an "$meil2" is most definitely not a valid e-mail address.

 

The single quotes may be his issue, I just copied and pasted his code, changed the title & message and did't see that. But as I under stand it, $meil2 is a variable like $to so it should be ...

 

mail("$meil2","VELEC 2012, Resgister succced! $datav","From: [email protected]");

 

or

 

mail("$meil2","Test Title", "Test Body", "From: [email protected]");

 

 

Hey Katyna, before you do all this change your code to

 

mail("$meil2","VELEC 2012, Resgister succced!","{$datav}","From: [email protected]");

mail("$jobmeil2","VELEC 2012, Register succed!","{$datav}","From: [email protected]");

 

and see what happens

Link to comment
https://forums.phpfreaks.com/topic/271370-php-dont-send-meils/#findComment-1396648
Share on other sites

No, quotes around single variables are not necessary at all. That's the same as writing 0 + # + 0 every time you want to write a number.

 

This is the proper way to write it:

mail($meil2,"VELEC 2012, Resgister succced!",$datav,"From: [email protected]");
mail($jobmeil2,"VELEC 2012, Register succed!",$datav,"From: [email protected]");

 

Which is exactly what wigwambam posted in the first reply to this thread.

Link to comment
https://forums.phpfreaks.com/topic/271370-php-dont-send-meils/#findComment-1396654
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.