smtp email php tutorial
DESCRIPTION
Learn how to send email through SMTP in ProdigyTRANSCRIPT
SMTP Email
Overview
Objective
Learn how to send email through simple mail transfer protocol(SMTP).
Requirements
Understanding the basics of sending an email in ProdigyView
Estimated Time
10 Minutes
www.prodigyview.com
Follow Along With Code Example
1. Download a copy of the example code at www.prodigyview.com/source.
2. Install the system in an environment you feel comfortable testing in.
3.Proceed to examples/util/SMTP.php
What is SMTPSMTP is short for Simple Mail Transfer Protocol. It is a standard for sending electronic mail over an IP(Internet Protocol).
SMTP normally uses port 25 or port 587.
SMTP normally requires a username and password, which makes it secure than PHP mail function.
You can have your own SMTP server but there are advantages to using a service that provides use of their SMTP servers.
www.prodigyview.com
SMTP ServiceUsing SMTP service has advantages over sending email with regular php mail.
1. Handles Mail Problems: Using a SMTP service will handle the problems encountered when sending mail such as bouncing, retries and queues.
2. Spam: Your emails sent are less likely to be considered spam if they are being sent but a trusted host.
Installing SMTPSMTP uses the PEAR mail classes. In order to use SMTP, below are instructions on how to install the required packages on Ubuntu and Centos.
Ubuntu
apt-get install pear
Centos
yum install php-pear
Both
pear install mail
pear install Net_SMTPwww.prodigyview.com
Sending Email SMTPIf you know the basics of sending email in ProdigyView, those same values are used when sending a regular email. The only difference is the SMTP information is passed when sending an email and the method PVMail::sendEmailSMTP() is used.
HostThe SMTP Host is the server that will be sending the email. The server is normally either an ip address (192.168.2.1) or a host name (mail.example.com).
www.prodigyview.com
PortSMTP runs on various ports but the most common is port 25 and Secure SMPT runs on port 465. The ports that accepts SMTP can be change if you have access to the mail server.
www.prodigyview.com
User & PasswordIf the SMTP service you are using is secure, a username and password should be required. This will keep unauthorized access from potential users such a spammers from sending emails.
www.prodigyview.com
Send the EmailThe last step in the process is sending the email.
1. Email Information
2. SMTP Information
3. Send email
www.prodigyview.com
API ReferenceFor a better understanding of the email, visit the api by clicking on the link below.
PVMail
www.prodigyview.com
More Tutorials
For more tutorials, please visit:
http://www.prodigyview.com/tutorials