Drew
Drew

Reputation: 251

PHPmailer SMTP auth configuration

Something doesn't work with my phpmailer smtp. The php page should connect to an smtp authenticated server (with username and password), then authenticate to the specific mailbox I choose with username and password.

Basically I have a two-step authentication: one to the server, one to the mailbox.

Thank you to who will be able to help me.

// SMTP auth
$mail->IsSMTP();
$mail->SMTPAuth     = ($smtp['auth'] ? true : false);
$mail->SMTPSecure   = ($smtp['secure'] ? $smtp['secure'] : false);
$mail->Host         = $smtp['host'];
$mail->Port         = $smtp['port'];
$mail->Username     = $smtp['username'];
$mail->Password     = $smtp['password'];

Upvotes: 1

Views: 21064

Answers (1)

dartonw
dartonw

Reputation: 300

To send email using SMTP authentication, you only need to log in once with a username and password permitted to relay through that server. When an SMTP server is also the Mail Exchanger (MX) for a domain, the username and password used for SMTP authentication are usually the same as those used to receive email using POP3/IMAP, where the mailbox exists on a Mail Delivery Agent (MDA) .

SMTP has no concept of mailboxes, it is only concerned with accepting messages from Mail User Agents (MUA), receiving messages from Message Transfer Agents (MTA) or submitting emails to a Mail Submission Agent (MSA), all of which communicate using the SMTP protocol.

Upvotes: 1

Related Questions