i update my question please help me again

the mail() function

Moderators: egami, macek, gesf

Post Reply
User avatar
raminkit
New php-forum User
New php-forum User
Posts: 48
Joined: Mon Oct 03, 2005 12:54 am

Mon Oct 03, 2005 1:03 am

everytime i create a php for mailing i get an error in line wiche i write my mail function for example:
<?php
$mail_to="raminkit@yahoo.com";
$mail_from="shahinkit@yahoo.com";
$mail_reply_to="nooshinkit@yahoo.com";
$mail_cc="raminkit2@yahoo.com,raminkit_2@yahoo.com";
$mail_bcc="mole@yahoo.com";
$mail_headers="From:$mail_from\r\nReply-to: $mail_reply_to\r\nCc: $mail_cc\r\nBcc: $mail_bcc";
$mail_subject="test";
$mail_body="eyval";
$sent=mail($mail_to,$mail_subject,$mail_body,$mail_headers);
if($sent)
echo "Successfully Sent";
else
echo "failed";
?>
I get this error "Warning: Unknown error in F:\web\regist.php on line 10
failed "
please help me :help:
Last edited by raminkit on Sun Oct 23, 2005 11:39 pm, edited 3 times in total.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2213
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Mon Oct 03, 2005 3:50 am

are you getting any errors?
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2213
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Mon Oct 03, 2005 3:51 am

next time use better subject and give more information.. use code tags while posting or i will get pissed
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Fri Oct 07, 2005 7:21 pm

Just do your IF statement like this:

Code: Select all

<?php

$result = mail($mail_to, $mail_subject, $mail_body, $mail_headers);

if($result) { 
     echo "Successfully Sent"; 
}
else { 
     echo "failed"; 
}

// I mean the code blocks!

?>
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

User avatar
raminkit
New php-forum User
New php-forum User
Posts: 48
Joined: Mon Oct 03, 2005 12:54 am

Thu Oct 13, 2005 12:29 pm

i do that script but i get same error :(

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2213
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Thu Oct 13, 2005 1:58 pm

whats on line ten then?!
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

Post Reply