Created
December 16, 2023 13:32
-
-
Save mahmutyukselmert/f8ed50f746802a1f7970af31a25204c4 to your computer and use it in GitHub Desktop.
WordPress sistemlerinizde basit SMTP işlemleri için bile eklenti kullanıldığını gördüm, bu işlemleri aşağıdaki kod eklemeleri ile hızlı bir şekilde yapabilirsiniz.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//theme functions.php for STMP Code. | |
add_action( 'phpmailer_init', 'my_phpmailer_smtp' ); | |
function my_phpmailer_smtp( $phpmailer ) { | |
$phpmailer->isSMTP(); | |
$phpmailer->Host = SMTP_server; | |
$phpmailer->SMTPAuth = SMTP_AUTH; | |
$phpmailer->Port = SMTP_PORT; | |
$phpmailer->Username = SMTP_username; | |
$phpmailer->Password = SMTP_password; | |
$phpmailer->SMTPSecure = SMTP_SECURE; | |
$phpmailer->From = SMTP_FROM; | |
$phpmailer->FromName = SMTP_NAME; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//wp-config.php for SMTP email settings | |
define( 'SMTP_username', '[email protected]' ); // username | |
define( 'SMTP_password', 'gmail-app-password' ); // password | |
define( 'SMTP_server', 'smtp.gmail.com' ); // SMTP server address | |
define( 'SMTP_FROM', '[email protected]' ); // Email Address | |
define( 'SMTP_NAME', 'Name and Surname' ); // From Name | |
define( 'SMTP_PORT', '587' ); // Server Port Number | |
define( 'SMTP_SECURE', 'tls' ); // Encryption - ssl or tls | |
define( 'SMTP_AUTH', true ); // Use SMTP authentication (true|false) | |
define( 'SMTP_DEBUG', 0 ); // for debugging purposes only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment