// plain
To set up PHPMailer to use Zimbra SMTP, the following steps should be taken:
- Install PHPMailer:
composer require phpmailer/phpmailer
- Create a new instance of PHPMailer:
$mail = new PHPMailer;
- Set the host and port of the Zimbra SMTP server:
$mail->Host = 'smtp.zimbra.com';
$mail->Port = 587;
- Set the authentication type to use:
$mail->SMTPAuth = true;
- Set the username and password to access the SMTP server:
$mail->Username = '[email protected]';
$mail->Password = 'password';
- Set the mailer type to use:
$mail->Mailer = 'smtp';
- Finally, send the mail:
$mail->send();
**
-
composer require phpmailer/phpmailer
- This command will install PHPMailer. -
$mail = new PHPMailer
- This will create a new instance of PHPMailer. -
$mail->Host = 'smtp.zimbra.com'
- This will set the host of the Zimbra SMTP server. -
$mail->Port = 587
- This will set the port of the Zimbra SMTP server. -
$mail->SMTPAuth = true
- This will set the authentication type to use. -
$mail->Username = '[email protected]'
- This will set the username to access the SMTP server. -
$mail->Password = 'password'
- This will set the password to access the SMTP server. -
$mail->Mailer = 'smtp'
- This will set the mailer type to use. -
$mail->send()
- This will send the mail.
## Helpful links
onelinerhub: How can I set up PHPMailer to use Zimbra SMTP?