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

}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.