WP Mail SMTP nastavení pro Wedos
Z nejakeho duvodu nemohu za zadnou cenu nastavit tento plugin, aby dokazal odesilat maily pres Wedos SMTP. Vzhledem k popularite tohoto pluginu se mi nechce verit, ze by nepodporoval nastaveni nutne pro Wedos SMTP.
Pokud zkusim nezavisle napsat jednoduchy php script pomoci PHPMailer, tak bez problemu zpravu odeslu, ale nastavit to pro WordPress pomoci WP Mail SMTP se zda nemozne.
Pro WP Mail SMTP mam nasledujici nastaveni:
[apcode language=“php“]
define( 'WPMS_ON', true ); define( 'WPMS_MAIL_FROM', 'info@mojedomena.cz' ); define( 'WPMS_MAIL_FROM_FORCE', true ); define( 'WPMS_MAIL_FROM_NAME', 'Moje Jmeno' ); define( 'WPMS_MAIL_FROM_NAME_FORCE', true ); define( 'WPMS_SET_RETURN_PATH', true ); define( 'WPMS_DO_NOT_SEND', false ); define( 'WPMS_SMTP_HOST', 'wes1-smtp.wedos.net' ); define( 'WPMS_SMTP_PORT', 587 ); define( 'WPMS_SSL', 'tls' ); define( 'WPMS_SMTP_AUTH', true ); define( 'WPMS_SMTP_USER', 'info@mojedomena.cz' ); define( 'WPMS_SMTP_PASS', 'mojeheslo' ); define( 'WPMS_SMTP_AUTOTLS', true ); define( 'WPMS_MAILER', 'smtp' );
[/apcode]
Nezavisly funkcni testovaci kod, vypada takto:
[apcode language=“php“]
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php';
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'wes1-smtp.wedos.net';
$mail->SMTPAuth = true;
$mail->Username = 'info@mojedomena.cz'
$mail->Password = 'mojeheslo';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->setFrom('info@mojedomena.cz', 'Moje Jmeno');
$mail->addAddress('mojejmeno@gmail.com', 'Receiver');
// Content
$mail->isHTML(true);
$mail->Subject = 'Hello World';
$mail->Body = 'This is a test email sent using PHPMailer with SMTP and SSL/TLS.';
$mail->AltBody = 'This is the plain text version of the email.';
$mail->send();
echo 'Message has been sent successfully.';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
[/apcode]
Otazka je, zda nekdo dokazal zprovoznit WP Mail SMTP v kombinaci s Wedos infrastrukturou?
