Jump to content

How to send mail with SMTP


Starfox

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/51921-how-to-send-mail-with-smtp/
Share on other sites

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";

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.