Post on 05-Dec-2014
description
Email Configuration
Overview
Objective
Learn how to configure the default values of the PVMail class.
Requirements
Understanding the basics of sending an email and SMTP 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/Mail_Configuration.php
Configuration InitThe init function of PVMail can be used to setup default configurations for the mail class. Through this tutorial, we will go over the defaults passed in the init.
Default SenderNormally, the sender has to be applied to the header of an email before sending an email. Applying a default sender will ensure that if no sender is set in the header, the email will be sent from the supplied email address.
MailerNatively, ProdigyView supports sending mail through php and smtp. By default using the method PVMail::sendMail will send an email using the php mail function. But the default can be changed to send email through SMTP by changing the ‘mailer’ value to smtp.
PVMail::sendMail
Send mail using PHP mail function
Send email through SMTP
If mailer is
php If mailer is smtp
Setting the mailer
Default SMTP HOSTIf the mailer is set to SMTP, a default SMTP host can be set here. When PVMail::sendMail or PVMail::sendEmailSMTP is called, this value will act as the default host if none is supplied.
Default SMTP UsernameIf the mailer is set to SMTP, a default SMTP username can be set here. When PVMail::sendMail or PVMail::sendEmailSMTP is called, this value will act as the default username if none is supplied.
Default SMTP PasswordIf the mailer is set to SMTP, a default SMTP password can be set here. When PVMail::sendMail or PVMail::sendEmailSMTP is called, this value will act as the default password if none is supplied.
Default SMTP PortIf the mailer is set to SMTP, a default SMTP port can be set here. When PVMail::sendMail or PVMail::sendEmailSMTP is called, this value will act as the default port if none is supplied.
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