Starfox Posted May 17, 2007 Share Posted May 17, 2007 Sorry folks to post another mail thread, but all the threads I searched for, were about issues and problems with php mail sending. I actually need to know HOW to do this, and I really don't need 90 lines of code. What I want to do, is create an email form, where the user can select emails by groups from a database. So based on what group the user selects, I'm guessing I'll use SQL select query to select the appropriate user emails and print them out to the address line of the form. But I need to know the actual coding for SMTP. Is it much more complicated than the mail() function? All help is greatly appreciated, thanx Starfox Quote Link to comment https://forums.phpfreaks.com/topic/51921-how-to-send-mail-with-smtp/ Share on other sites More sharing options...
john010117 Posted May 18, 2007 Share Posted May 18, 2007 All you need is mail(). But be make sure to add tons of security features, so there won't be any spammers. Quote Link to comment https://forums.phpfreaks.com/topic/51921-how-to-send-mail-with-smtp/#findComment-256042 Share on other sites More sharing options...
neel_basu Posted May 18, 2007 Share Posted May 18, 2007 mail() function do's the Following things ------------------------------------------ 1. Opens a Socket on port number 25 (as specified on php.ini file) 2. sends SMTP commands to it (HELO localhost) and gets answeres from teh SMTP server and in this way it sends teh mail. and SMTP mails also do the same things but its more reliable and Accurate if its open source as you can configure the SMTP commands' Sequences. Do you wanna know that SMTP commands ?? or Use something like I use ------------------------------------- I use <?php $test = new group_mail("http://localhost/demo_group.php?pass=secure", "Mail_Subject", "Mail Body"); //demo_group.php fetches the database and gather's teh Group members in a parsable format if(!$test->send()) { echo "Mail Not Sent Succfully\n"; print_r($test->error);//Print The Errors } else { echo "Mail Sent Successfully\n"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/51921-how-to-send-mail-with-smtp/#findComment-256112 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.