ShaKeD Posted September 15, 2006 Share Posted September 15, 2006 Hey again, I was trying to use mail(); function and I got no luck, why is that? [code]mail($user,$subject."(from)",$message,"From $user");[/code]$user= my email .. $subject = subject from edit box$message= from edit box... what do you think? Link to comment https://forums.phpfreaks.com/topic/20868-mail-function/ Share on other sites More sharing options...
obsidian Posted September 15, 2006 Share Posted September 15, 2006 youre header is not assigned properly. if you're using the "From" header, you need to have a colon following the "From":[code]<?phpmail($user, $subject . "(from)", $message, "From: $user");?>[/code] Link to comment https://forums.phpfreaks.com/topic/20868-mail-function/#findComment-92430 Share on other sites More sharing options...
ShaKeD Posted September 15, 2006 Author Share Posted September 15, 2006 I didn't understand the differenet.. .this is my code.. : [code] <?php... $headers = "From: <email>\r\nReply-To: email"; mail($user,$subject,$message,$headers);...?>[/code] Link to comment https://forums.phpfreaks.com/topic/20868-mail-function/#findComment-92438 Share on other sites More sharing options...
AndyB Posted September 15, 2006 Share Posted September 15, 2006 [quote author=ShaKeD link=topic=108179.msg434920#msg434920 date=1158331463]this is my code ...[/quote]And that's different from what you posted to start this thread. Instead of posting one or two lines of code, post anything that relates to the construction of headers and variables that end up in the mail() function. Link to comment https://forums.phpfreaks.com/topic/20868-mail-function/#findComment-92444 Share on other sites More sharing options...
ShaKeD Posted September 15, 2006 Author Share Posted September 15, 2006 ok so I`m using mbot plugin for miranda, this plugin give you to bulid things with php and use them on the miranda, so I have start to work on script that sends emaill throw miranda.. so I did this function : function dlg_callback($ok,$param) { if($ok == 0)return 1; //cancel or close $dlg = mb_DlgGet(); $user = mb_DlgGetText($dlg,1000); $subject = mb_DlgGetText($dlg,1002); $message = mb_DlgGetText($dlg,1004); $headers = "From: <email>\r\nReply-To: email"; if($subject != "" && $message != ""){ mail($user,$subject,$message,$headers); mb_msgbox("your message has been sent to ".$user); return 1; }else{ mbox("you must use the subject and message body both."); return 0; //if you want to finish the dialog return "end"; } } I checked if I get somthing in $message,$subject and $user and I did, I got everything I needfor ex. : $user = [email protected]$subject = hey whats up! $message = this is a testthe problem the I don't get any mail at all.. what can I do ? 10x :) Link to comment https://forums.phpfreaks.com/topic/20868-mail-function/#findComment-92494 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.