hamza Posted January 21, 2008 Share Posted January 21, 2008 ACTUAlly i need to know that is it possible to send email on windows with php mail function ------------------------------------- If yes then how i do not need parameters help. And tell me about the php.ini setting for mail function ---------------------------------------- and tell me one thing more any mail server required for this . thanks Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/ Share on other sites More sharing options...
rajivgonsalves Posted January 21, 2008 Share Posted January 21, 2008 you'll have to have your SMTP up and running thats all... Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-445100 Share on other sites More sharing options...
hamza Posted January 21, 2008 Author Share Posted January 21, 2008 smtp_port = 25 smtp = mail.runbox.com sendmail_from = "????????????" error: ----- is not able to connect to the mail server check your ini_seting?? Please tellme about that Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-445106 Share on other sites More sharing options...
rajivgonsalves Posted January 21, 2008 Share Posted January 21, 2008 you can send the mail from any id unless the smtp has authentication, Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-445108 Share on other sites More sharing options...
hamza Posted January 22, 2008 Author Share Posted January 22, 2008 My php.ini setting are this -------------------------- [mail function] ; For Win32 only. SMTP = mail.technology-uprising.com smtp_port = 25 ; For Win32 only. sendmail_from = ahtasham82@gmail.com And error is not able to connect to mail server But still say that not able to connect to the mail server please help me i want to send a simple email using php mail function thanks Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-445983 Share on other sites More sharing options...
rajivgonsalves Posted January 22, 2008 Share Posted January 22, 2008 what type of mail server it is ? some server needs authentication as said before Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-445985 Share on other sites More sharing options...
jintot Posted January 22, 2008 Share Posted January 22, 2008 how about if the smtp server has an authentication like yahoo? how can i set up it in php.ini? Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-446057 Share on other sites More sharing options...
hamza Posted January 23, 2008 Author Share Posted January 23, 2008 I REALLY DONT NO WHAT TYPE OF THIS MAIL SERVER my friend told me that bring this code and paste it in your php.ini then you will able to send email . BUT I HAVE TRIed www.RUNBOX.com IT IS ALSO AN MAIL SERVER HOSTIng. ---------------------------------------------------------------------------- Please DO ME A FAVIOUR GO TO RUNBOx AND MAKE A SIMPLE FREE ACCOUNT . AND TeLl me It is possible to use that mail server to send email thanks --------------------------------------------------------------------------- Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-446754 Share on other sites More sharing options...
rajivgonsalves Posted January 23, 2008 Share Posted January 23, 2008 what exactly did you paste in your php.ini file ? Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-446767 Share on other sites More sharing options...
DarkPrince2005 Posted January 23, 2008 Share Posted January 23, 2008 I also had the problem when setting php.ini file but found that setting it in your code works. <?php //set the smtp server in the ini file ini_set('SMTP','smtp.address.here'); //set where the mail is sent from in the ini file ini_set('send_from','emailaddress@domain.com'); if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "youremail@domain.com", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='post' action='Working.php'> Email: <input name='email' type='text'><br> Subject: <input name='subject' type='text'><br> Message:<br> <textarea name='message' rows='15' cols='40'> </textarea><br> <input type='submit'> </form>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-446821 Share on other sites More sharing options...
hamza Posted January 23, 2008 Author Share Posted January 23, 2008 Yaaar rageave ------- he gave me this code like shown below ----------------------------------------------- [mail function] ; For Win32 only. SMTP = mail.his mail server name.com smtp_port = 25 ; ; For Win32 only. ;sendmail_from = myfriend_email_Address ---------------------------------------------- but when i reuning this it said not able to connect to mail server and onething more yaar please give me to tell me any mail server address for use. Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-446824 Share on other sites More sharing options...
hamza Posted January 23, 2008 Author Share Posted January 23, 2008 Ragive ---------------- now i am trying this code but they said ERROR: ---------------------------------------------------- Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.runbox.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\AppServ\www\mail.php on line 18 Thank you for using our mail form --------------------------------------------------- my code is : <?php //set the smtp server in the ini file ini_set('SMTP','smtp.runbox.com'); ini_set('SMTP_port','26'); //set where the mail is sent from in the ini file ini_set('send_from','hamzanama@indiatimes.com'); if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "hamzanama@indiatimes.com", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='post' action=''> Email: <input name='email' type='text'><br> Subject: <input name='subject' type='text'><br> Message:<br> <textarea name='message' rows='15' cols='40'> </textarea><br> <input type='submit'> </form>"; } ?> Please try this code and tell me is it right or wrong i am waiting for you Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-446827 Share on other sites More sharing options...
DarkPrince2005 Posted January 23, 2008 Share Posted January 23, 2008 Try copying and pasting this, and just remember to define the forms action to the same name as the page <?php //set the smtp server in the ini file ini_set('SMTP','smtp.runbox.com'); //set where the mail is sent from in the ini file ini_set('send_from','hamzanama@indiatimes.com'); if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "hamzanama@indiatimes.com", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='post' action=''> Email: <input name='email' type='text'> Subject: <input name='subject' type='text'> Message: <textarea name='message' rows='15' cols='40'> </textarea> <input type='submit'> </form>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-446829 Share on other sites More sharing options...
hamza Posted January 23, 2008 Author Share Posted January 23, 2008 my page name is mail.php ---------------------------- error is : Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.runbox.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\AppServ\www\mail.php on line 16 Thank you for using our mail form Please visit the the website to know about the runbox -- www.runbox.com there is free signup Please help me .......................... Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-446852 Share on other sites More sharing options...
hamza Posted January 23, 2008 Author Share Posted January 23, 2008 After modification my code is look like --------------------------------- <?php //set the smtp server in the ini file ini_set('SMTP','smtp.runbox.com'); //set where the mail is sent from in the ini file ini_set('send_from','hamzanama@indiatimes.com'); if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "hamzanama@indiatimes.com", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='post' action='mail.php'> Email: <input name='email' type='text'> Subject: <input name='subject' type='text'> Message: <textarea name='message' rows='15' cols='40'> </textarea> <input type='submit'> </form>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-446854 Share on other sites More sharing options...
DarkPrince2005 Posted January 23, 2008 Share Posted January 23, 2008 looks correct just add a semicolon after the last curly bracket then it should work Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-446864 Share on other sites More sharing options...
hamza Posted January 23, 2008 Author Share Posted January 23, 2008 STILL NOT WORK AT ALL -------------------------------------------- <?php //set the smtp server in the ini file ini_set('SMTP','smtp.runbox.com'); //set where the mail is sent from in the ini file ini_set('send_from','hamzanama@indiatimes.com'); if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "hamzanama@indiatimes.com", "Subject: $subject",$message, "From: $email" ); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='post' action='mail.php'> Email: <input name='email' type='text'> Subject: <input name='subject' type='text'> Message: <textarea name='message' rows='15' cols='40'> </textarea> <input type='submit'> </form>"; }; ?> Quote Link to comment https://forums.phpfreaks.com/topic/87036-php-mail/#findComment-447060 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.