smtp email php tutorial

12
SMTP Email

Upload: prodigyview

Post on 05-Dec-2014

6.608 views

Category:

Technology


0 download

DESCRIPTION

Learn how to send email through SMTP in Prodigy

TRANSCRIPT

Page 1: SMTP Email PHP Tutorial

SMTP Email

Page 2: SMTP Email PHP Tutorial

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

Page 3: SMTP Email PHP Tutorial

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

Page 4: SMTP Email PHP Tutorial

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

Page 5: SMTP Email PHP Tutorial

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.

Page 6: SMTP Email PHP Tutorial

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

Page 7: SMTP Email PHP Tutorial

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.

Page 8: SMTP Email PHP Tutorial

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

Page 9: SMTP Email PHP Tutorial

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

Page 10: SMTP Email PHP Tutorial

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

Page 11: SMTP Email PHP Tutorial

Send the EmailThe last step in the process is sending the email.

1. Email Information

2. SMTP Information

3. Send email

www.prodigyview.com

Page 12: SMTP Email PHP Tutorial

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