anirudhtomer Posted March 11, 2010 Share Posted March 11, 2010 HI everyone I am a beginner in PHP I was trying to use the PHP mail() function to send mail. after hours of search on various forums i got a few basic things that I need a SMTP server installed on my machine (by now I've got what SMTP is)...now the problem is mostly all forums are suggesting me to use Softwares like PHP-Mailer, which I don't want to use until I get to know how PHP uses its "mail()" function to send emails from "localhost" (by editing PHP.ini file) Can I send mails by just making some simple changes in my php.ini file & using the mail function to send mail from localhost if not then why the "mail()" function is there in PHP...when the job can be done by using some softwares like PHP-Mailer as suggested by http://www.vishalkumar.in/2009/06/php-mail-using-gmail-smtp-tutorial/ Please help me out, I need guidance & I am very much eager to learn this stuff or any link to a good tutorial that can resolve my problem Link to comment https://forums.phpfreaks.com/topic/194914-using-php-mail-function/ Share on other sites More sharing options...
TeddyKiller Posted March 11, 2010 Share Posted March 11, 2010 If mail() function wasn't there in PHP, you wouldn't have PHP-mailer. You can use third party softwares, I prefer to make my own. You learn more. Link to comment https://forums.phpfreaks.com/topic/194914-using-php-mail-function/#findComment-1024812 Share on other sites More sharing options...
XeNoMoRpH1030 Posted March 11, 2010 Share Posted March 11, 2010 The mail() function is extremely basic. It can't do SMTP authentication, but you technically should have to since most SMTP servers on localhost (your machine) would allow emails to be sent from itself without authentication. If you are looking for a SMTP server, there are plenty of free ones out there. Just google "free SMTP server". If you have a SMTP server on the localmachine, nothing in the php.ini file should have to be changed (I think). Link to comment https://forums.phpfreaks.com/topic/194914-using-php-mail-function/#findComment-1024815 Share on other sites More sharing options...
anirudhtomer Posted March 11, 2010 Author Share Posted March 11, 2010 yeah that's fine using some SMTP servers. But I want to know if I can send mails without using them ( which dosen't seem to be possible without SMTP as e-mails are based on them) i.e just by making changes in php.ini file Link to comment https://forums.phpfreaks.com/topic/194914-using-php-mail-function/#findComment-1024821 Share on other sites More sharing options...
XeNoMoRpH1030 Posted March 11, 2010 Share Posted March 11, 2010 As you said, I don't think it's possible to send email without a SMTP server. http://www.php.net/manual/en/mail.configuration.php shows you the configuration options. You could technically use a different SMTP server, but it would most likely require SMTP authentication as most servers do not allow relaying. If you need a more advanced mail function, try the pear package PEAR::Mail. Link to comment https://forums.phpfreaks.com/topic/194914-using-php-mail-function/#findComment-1024826 Share on other sites More sharing options...
anirudhtomer Posted March 11, 2010 Author Share Posted March 11, 2010 thanks buddy I will now install one & work upon it to know how things work...as that's the only possible way to get to know the working Link to comment https://forums.phpfreaks.com/topic/194914-using-php-mail-function/#findComment-1024828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.