OverviewObjectiveLearn how to send email through simple mail transferprotocol(SMTP).Requirements Understanding the basics of sending an email in ProdigyViewEstimated Time10 Minutes www.prodigyview.com
Follow Along With Code Example1. 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 astandard for sending electronic mail over an IP(InternetProtocol).SMTP normally uses port 25 or port 587.SMTP normally requires a username andpassword, which makes it secure than PHP mailfunction.You can have your own SMTP server but there areadvantages to using a service that provides use of theirSMTP servers. www.prodigyview.com
SMTP ServiceUsing SMTP service has advantages over sending emailwith 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 useSMTP, below are instructions on how to install the requiredpackages on Ubuntu and Centos.Ubuntu apt-get install pearCentos yum install php-pearBoth pear install mail pear install Net_SMTP www.prodigyview.com
Sending Email SMTPIf you know the basics of sending email in ProdigyView, thosesame values are used when sending a regular email. The onlydifference is the SMTP information is passed when sending anemail and the method PVMail::sendEmailSMTP() is used.
HostThe SMTP Host is the server that will be sending theemail. 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 port25 and Secure SMPT runs on port 465. The ports thataccepts SMTP can be change if you have access to themail server. www.prodigyview.com
User & PasswordIf the SMTP service you are using is secure, a usernameand password should be required. This will keepunauthorized access from potential users such aspammers from sending emails. www.prodigyview.com
Send the Email The last step in the process is sending the email.1. Email Information2. SMTP Information3. Send email www.prodigyview.com
API ReferenceFor a better understanding of the email, visit the api byclicking on the link below.PVMail More TutorialsFor more tutorials, please visit:http://www.prodigyview.com/tutorials www.prodigyview.com