Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
266 views
in Technique[技术] by (71.8m points)

php - Problem using SwiftMailer on localhost and WAMP

I have a script that is for registering users on the site, and will send a confirmation/verification email , however I am getting a n error and cannot seem to find what is wrong, I am new to swiftmailer.

Error is enter image description here

Script i am using is as follows :

$transporter = (new Swift_SmtpTransport('smtp.gmail.com', 465, 'ssl'))

->setUsername('xxxxxxxxxxxxx')

->setPassword('xxxxxxxxxxxxx');

$mailer = new Swift_Mailer($transporter);

// Create a message

$message = (new Swift_Message('Please Verify Email Address!'))

->setFrom([$email => $firstname . ' ' . $lastname])

->setTo($email)

->addPart($msg, "text/html")

->setBody('Hello! User');

// Send the message

$result = $mailer->send($message);


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...