2. 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
3. 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
4. What is SMTP
SMTP 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
5. SMTP Service
Using 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.
6. Installing SMTP
SMTP 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_SMTP
www.prodigyview.com
7. Sending Email SMTP
If 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.
8. Host
The 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
9. Port
SMTP 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
10. User & Password
If 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
11. Send the Email
The last step in the process is sending the email.
1. Email Information
2. SMTP Information
3. Send email
www.prodigyview.com
12. API Reference
For a better understanding of the email, visit the api by
clicking on the link below.
PVMail
More Tutorials
For more tutorials, please visit:
http://www.prodigyview.com/tutorials
www.prodigyview.com