CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 please help i have mail problem

Print topic Send  topic

Author Message
beshoo
Posted: 01/20/2002, 4:24 PM

see this AfterInsert Event code :


//-------------------------------
// Arts_items_New AfterInsert Event begin
$to_email = "newadd@syrianobles.com";
$from_email = get_param("Email");
$subject = "New art addition";
//-------------------------------
$body = " Hello Syria Nobles Admin :) !" . chr(13) .
"This is a new addition to art category section and yo can edit it on line." . chr(13) .
"The information is the following :" . chr(13) .
"Category :" . get_param("ID") . chr(13) .
"Company name :" . get_param("Company") . chr(13) .
"Responsible :" . get_param("Contactperson") . chr(13) .
"Address :" . get_param("Address") . chr(13) .
"Phone :" . get_param("Phone") . chr(13) .
"E-mail :" . get_param("Email") . chr(13) .
"Fax :" . get_param("Fax") . chr(13) .
"P.O.Box :" . get_param("Pobox") . chr(13) .
"Line of Business :" . get_param("LineofBusiness") . chr(13) .
"Web site :" . get_param("website") . chr(13) .
"Country :" . get_param("country") . chr(13) . chr(13) .
"may you like to edit this addition on line. :)" . chr(13) . chr(13) .
"http://www.syrianobles.com/admin/" . $sActionFileName . "?ArtID=" . get_param("ID");
mail($to_email, $subject, $body,"From: $from_email\nReply-To: $from_email\nX-Mailer: PHP/");
// Arts_items_New AfterInsert Event end

break;
}
//-------------------------------
header("Location: " . $sActionFileName . $sParams);
exit;
//-------------------------------
// Arts_items_New Action end
//-------------------------------
}


///----------------------

i have an error when i tray to send the email the error is

Warning: Cannot add header information - headers already sent by (output started at c:\phpdev\www\nobles\data\arts_items_new.php:290) in c:\phpdev\www\nobles\data\arts_items_new.php on line 296

line 290 is :
mail($to_email, $subject, $body,"From: $from_email\nReply-To: $from_email\nX-Mailer: PHP/");

line 296 is :
header("Location: " . $sActionFileName . $sParams);

so what i have to do ?






+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



CodeCharge Support
Posted: 01/21/2002, 2:09 AM

Beshoo,
is it the full text of message you get? Do you get any error messages before "Warning"? Or any other output on the screen?
CodeCharge Support
Posted: 01/21/2002, 2:09 AM

Beshoo,
is it the full text of message you get? Do you get any error messages before "Warning"? Or any other output on the screen?
beshoo
Posted: 01/21/2002, 5:47 AM

thank you
yes i have the email error that it can not conect to the mail server
but i know why cos it is in local server
and the message that i put it here :)
please more help
Nicole
Posted: 01/21/2002, 6:15 AM

Bashoo,
the warning message occurs due to error text output. You cannot output anything on the form before redirect code otherwise you get the warning message and redirection code won't execute.
beshoo
Posted: 01/21/2002, 2:38 PM


yes i hve a error messages
it is a mail conection :) but i know why cos i ame on local server :(

in the forms Nicole sayed :
the warning message occurs due to error text output. You cannot output anything on the form before redirect code otherwise you get the warning message and redirection code won't execute.


but i think that is not right
cos in the tellafriend e.g
you use the same thing and you can see the code here :


// TellAFriend Insert Event begin
$to_email = get_param("to_email");
$from_email = get_param("from_email");
$subject = "Web Page from " . get_param("from_name");

$body = "Hello " . get_param("to_name") . "!" . chr(13) .
chr(13) . get_param("from_name") .
" sent you this page from the CodeCharge Web Site." . chr(13) .
"http://www.codecharge.com" . chr(13) . chr(13) . "Comments from " .
get_param("from_name") . ":" . chr(13) . get_param("comments");

$db->query("insert into tellafriend_log (sending_date, from_email, from_name, to_email, to_name, message_comments) values (" .
tosql(date("Y-m-d G:i:s"), "Text") . "," .
tosql(get_param("from_email"),"Text") . "," .
tosql(get_param("from_name"),"Text") . "," .
tosql(get_param("to_email"),"Text") . "," .
tosql(get_param("to_name"),"Text") . "," .
tosql(get_param("comments"),"Text") . ")");

mail($to_email, $subject, $body,"From: $from_email\nReply-To: $from_email\nX-Mailer: PHP/" . phpversion());
// TellAFriend Insert Event end
file://-------------------------------
break;
}
file://-------------------------------
header("Location: " . $sActionFileName);
exit;
file://-------------------------------



but is the sql code that u put it make it work ?
$db->query("insert into tellafriend_log (sending_date, from_email, from_name, to_email, to_name, message_comments) values (" .
tosql(date("Y-m-d G:i:s"), "Text") . "," .
tosql(get_param("from_email"),"Text") . "," .
tosql(get_param("from_name"),"Text") . "," .
tosql(get_param("to_email"),"Text") . "," .
tosql(get_param("to_name"),"Text") . "," .
tosql(get_param("comments"),"Text") . ")");

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

if that right i will be sorry cos it is to hard to cansel all my work and go to
type the sql in the PHP
please help me


===
what i nead that if any user put any new thing
i will have an email and the email have all data that the user put it and the url to it
the ufter inseart code that i made it is :

file://------------------------
file://-------------------------------
// Arts_items_New AfterInsert Event begin
$to_email = "newadd@syrianobles.com";
$from_email = get_param("Email");
$subject = "New art addition";
file://-------------------------------
$body = " Hello Syria Nobles Admin :) !" . chr(13) .
"This is a new addition to art category section and yo can edit it on line." . chr(13) .
"The information is the following :" . chr(13) .
"Category :" . get_param("ID") . chr(13) .
"Company name :" . get_param("Company") . chr(13) .
"Responsible :" . get_param("Contactperson") . chr(13) .
"Address :" . get_param("Address") . chr(13) .
"Phone :" . get_param("Phone") . chr(13) .
"E-mail :" . get_param("Email") . chr(13) .
"Fax :" . get_param("Fax") . chr(13) .
"P.O.Box :" . get_param("Pobox") . chr(13) .
"Line of Business :" . get_param("LineofBusiness") . chr(13) .
"Web site :" . get_param("website") . chr(13) .
"Country :" . get_param("country") . chr(13) . chr(13) .
"may you like to edit this addition on line. :)" . chr(13) . chr(13) .
"http://www.syrianobles.com/admin/" . $sActionFileName . "?ArtID=" . get_param("ID");
mail($to_email, $subject, $body,"From: $from_email\nReply-To: $from_email\nX-Mailer: PHP/");
// Arts_items_New AfterInsert Event end

break;
}
file://-------------------------------
header("Location: " . $sActionFileName . $sParams);
exit;
file://-------------------------------
// Arts_items_New Action end
file://-------------------------------
}


///----------------------
but in TellAFriend i know that you type the sql to put the data in the base
but y made a send to !
why in TellAFriend you dont have any error ?


please i will kill my self if you will tell me
"beshoo you have to type the sql as it like TellAFriend "



beshoo
Posted: 01/22/2002, 3:24 AM

please more help ?
beshoo
Posted: 01/22/2002, 3:24 AM

please more help ?

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.