Jump to content

Archived

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

ShaKeD

mail() function!

Recommended Posts

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?

Share this post


Link to post
Share on other sites
youre header is not assigned properly. if you're using the "From" header, you need to have a colon following the "From":
[code]
<?php
mail($user, $subject . "(from)", $message, "From: $user");
?>
[/code]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
[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.

Share this post


Link to post
Share on other sites
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 need
for ex. :
$user = myemail@gmail.com
$subject = hey whats up!
$message = this is a test

the problem the I don't get any mail at all..

what can I do ?

10x :)

Share this post


Link to post
Share on other sites

×

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.