rs_nayr Posted March 4, 2009 Share Posted March 4, 2009 good day everyone,,, need some info i'm exploring php mail function, but after reading some info's on this subject it's getting more confusing and i think this after signing to this forum would be the best way to make things clearer,, i used this code,, to test if will work,, <?php $sentmail=mail("someone@example.com", "test mail function", "hellomail"); if($sentmail){ echo "Email Has Been Sent ."; } else { echo "Cannot Send Email "; } ?> i'm using apache wampserver2.0 for my localserver, i run this file and the page returns the string "email has been sent",, my question is, 1. can i test phpmail localy? 1. how to view the email sent by php? 2. can i use email address something like rs@localhost? 3. do i need other softwares to view the email any info's and replies are greatly appreciated,, Quote Link to comment https://forums.phpfreaks.com/topic/147921-php-mail-function/ Share on other sites More sharing options...
phpdragon Posted March 4, 2009 Share Posted March 4, 2009 The email gets sent to the email you specify, to test put your email address and the email will come to your email box in the program you use to check your email, if you dont receive the email then there is an issue. Sometimes it may take a few minutes to go through, but usually fairly fast. Quote Link to comment https://forums.phpfreaks.com/topic/147921-php-mail-function/#findComment-776373 Share on other sites More sharing options...
rs_nayr Posted March 4, 2009 Author Share Posted March 4, 2009 The email gets sent to the email you specify, to test put your email address and the email will come to your email box in the program you use to check your email, if you dont receive the email then there is an issue. Sometimes it may take a few minutes to go through, but usually fairly fast. thanks for your reply sir,, what program will i use to check my email? i'm on localhost can php mail send emails on the web? even the page is not uploaded to the web? Quote Link to comment https://forums.phpfreaks.com/topic/147921-php-mail-function/#findComment-776380 Share on other sites More sharing options...
premiso Posted March 4, 2009 Share Posted March 4, 2009 To Check EMail you need IMAP support and php functions, if you want to code it yourself. For your own email you can check it with whatever you want, whether it is GMail, OutLook The Bat, Thunderbird etc. If you want it done PHP, you should look for an email script or use imap to code it yourself. As for sending mail on localhost, you cannot without a mail server. Which I doubt you have installed, given you are on Windows. An easy solution around this is to signup for a GMail account and use phpGMailer (google that) to send out emails over GMail's server SMTP. Or signup for a "Free" (if there are any) SMTP server and add those items to the php.ini. But for that you need to make sure your ISP does not block Port 25. Quote Link to comment https://forums.phpfreaks.com/topic/147921-php-mail-function/#findComment-776495 Share on other sites More sharing options...
rs_nayr Posted March 5, 2009 Author Share Posted March 5, 2009 thanks for your reply sir,, i used argosoft for my smtp, and what should i add to my php.ini, this is the current setting of my mail function on php.ini [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. sendmail_from = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = Quote Link to comment https://forums.phpfreaks.com/topic/147921-php-mail-function/#findComment-776912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.