Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

i update my question please help me again

the mail() function

Moderators: macek, egami, gesf

i update my question please help me again

Postby raminkit » 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
raminkit
New php-forum User
New php-forum User
 
Posts: 48
Joined: Mon Oct 03, 2005 12:54 am

Postby Alexej Kubarev » Mon Oct 03, 2005 3:50 am

are you getting any errors?
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby Alexej Kubarev » 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
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby gesf » 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!

?>
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby raminkit » Thu Oct 13, 2005 12:29 pm

i do that script but i get same error :(
User avatar
raminkit
New php-forum User
New php-forum User
 
Posts: 48
Joined: Mon Oct 03, 2005 12:54 am

Postby Alexej Kubarev » Thu Oct 13, 2005 1:58 pm

whats on line ten then?!
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län


Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron