Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13

Thread: Mail

  1. #1
    Regular Coder
    Join Date
    Apr 2003
    Location
    Canada, Ontario, Mississauga
    Posts
    312
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mail

    Hello

    I created a forgot_pass.php page that allow user to enter his or her email address and the password will mail to his or her email.

    the code for mail is
    mail($contactemail, $subject, $message, $headers); /* this is line 21 and all variables are set correctly*/

    Here is my error message
    Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\BadBlue\PE\web\php\testing_int.php on line 21

    Here is my php.ini setting
    [mail function]
    ; For Win32 only.
    SMTP = localhost

    ; For Win32 only.
    sendmail_from = mike@mikemike.com

    If you need more info, please let me know.

    Thank you so much

    Mike

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you have a SMTP server? On your localhost?

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What's on line 21?? and two lines above it.

  • #4
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, are you talking to me?

    Cos you can have your SMTP set to localhost but if it does not exist then it wont work.

    Sorry if you werent talkin to me

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Should have specified, my bad

    Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\BadBlue\PE\web\php\testing_int.php on line 21
    Was talking to weronpc

    Duniyadnd

  • #6
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ok.

    Sorry...

    If you do not have an smtp server, you can (sometimes) use your own server.

    Find the SMTP line in php.ini and change it to something like:

    mail.myisp.com

    or whatever your isp's mail server is.

  • #7
    Regular Coder
    Join Date
    Apr 2003
    Location
    Canada, Ontario, Mississauga
    Posts
    312
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for you reply,

    Here is my situation, I am at work learning php (cuz my work sux). I will finish my work end of this month and I will go back home and I will have my own internet access (Calbe Internet).

    I will set up php, mysql and aparche.

    I am not sure how mail server works, but what kind of setting I have to do in order to get the mail() function to work?

    Thank you,

    Mike

    PS: Is it posible to create my own mail server? eg, allow user to create a user name and use my ip as mailing address. (user_name@my_ip_address)

  • #8
    Regular Coder
    Join Date
    Apr 2003
    Location
    Canada, Ontario, Mississauga
    Posts
    312
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Duniyadud,

    here is the code

    $get_info = mysql_fetch_assoc($mail_sql);

    $myname = "Mike";
    $myemail = "chim@dfo.ca";

    $contactname = "$get_info[user]";
    $contactemail = "$get_info[email]";

    $message = "here is your request \n Username = \"$get_info[user]\"\n Password = \"$get_info[pass]\"\n\nHave a nice day!!!";
    $subject = "Password";

    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From: ".$myname." <".$myemail.">\r\n";
    $headers .= "To: ".$contactname." <".$contactemail.">\r\n";
    $headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
    $headers .= "X-Priority: 1\r\n";
    $headers .= "X-MSMail-Priority: High\r\n";
    $headers .= "X-Mailer: Mike Server";

    mail($contactemail, $subject, $message, $headers);

  • #9
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For PHP beginners, I would reccomend phpdev from http://www.firepages.com.au

  • #10
    Regular Coder
    Join Date
    Apr 2003
    Location
    Canada, Ontario, Mississauga
    Posts
    312
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Missing-Score

    Hello,

    http://www.firepages.com.au/ is a really nice site, thank you.

    Can you tell me what do I need to use the mail() function in PHP?

    Another question (little bit off the topic), I want to install PHP, Aparche, and Mysql. Why people perfer using Linux OS than Window OS? Most people said it's better using Linux but others said Linux is harder to use (installation). But the best, Linux is free..

    One more, how do I create a page that when use click on the smilie faces (like this page ), and the image will pop up after submited?

    Thank you

    Mike

  • #11
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VERY off topic...

    Right, 1: I use PHP dev ( from the firepages.com.au site ) so I have no experience manually installing Apache, PHP and Mysql. The phpdev program installs it automatically.

    to use the mail function, you need an SMTP server.

    3: Clickable smilies, hmm. I dunno what you mean. I have my forum where I have clickable smiles, but do you want to know how to make the code appear in the box when you click them, or how to change : ) to when the code is submitted?

    If you want to change the code into a smiley, I would do it like this...

    PHP Code:

    $message 
    str_replace(": )"'<img src="happy.gif" />'$message); 

    Hope this helps you

  • #12
    Regular Coder
    Join Date
    Apr 2003
    Location
    Canada, Ontario, Mississauga
    Posts
    312
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanx

    One more thing, what is a SMTP server??

  • #13
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    An SMTP server is a server that can be used to send e-mail. Example of a SMTP server address is:

    mail.freeserve.com
    smtp.freeola.net

    To alter the SMTP server, you will have to look in PHP ini.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •