{"id":1803,"date":"2022-05-17T17:15:43","date_gmt":"2022-05-17T17:15:43","guid":{"rendered":"https:\/\/shaplakanon.com\/wpsupport\/?p=1803"},"modified":"2022-05-17T17:15:45","modified_gmt":"2022-05-17T17:15:45","slug":"how-to-use-smtp-to-send-email-in-wordpress-without-smtp-plugin","status":"publish","type":"post","link":"https:\/\/shaplakanon.com\/wpsupport\/how-to-use-smtp-to-send-email-in-wordpress-without-smtp-plugin\/","title":{"rendered":"How to use smtp to send email in wordpress without smtp plugin?"},"content":{"rendered":"\n
The\u00a0wp_mail()<\/a>\u00a0function relies on the\u00a0PHPMailer<\/a>\u00a0class to send email through PHP\u2019s\u00a0 This action is initiated with `do_action_ref_array` rather than `do_action`. You still hook to it with `do_action`. However, there are some notable differences:<\/p>\n\n\n\n This is an example of establishing an SMTP connection using the ` If you need any help with this action hook, feel free to comment below. If you are interested in our paid service , check out our\u00a0wordpress maintenance service<\/a>\u00a0website and talk to real people..<\/p>\n","protected":false},"excerpt":{"rendered":" The\u00a0wp_mail()\u00a0function relies on the\u00a0PHPMailer\u00a0class to send email through PHP\u2019s\u00a0mail\u00a0function. The\u00a0phpmailer_init\u00a0action hook in wordpress allows you to hook to the phpmailer<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[296,51],"tags":[],"class_list":["post-1803","post","type-post","status-publish","format-standard","hentry","category-tutorial","category-wordpress"],"yoast_head":"\nmail<\/code>\u00a0function. The\u00a0
phpmailer_init<\/code>\u00a0action hook in wordpress<\/a> allows you to hook to the phpmailer object and pass in your own arguments.<\/p>\n\n\n\n
phpmailer_init<\/code>` action:<\/p>\n\n\n\n
function my_phpmailer_example( $phpmailer ) {\r\n $phpmailer->isSMTP(); \r\n $phpmailer->Host = 'smtp.example.com';\r\n $phpmailer->SMTPAuth = true; \/\/ Ask it to use authenticate using the Username and Password properties\r\n $phpmailer->Port = 25;\r\n $phpmailer->Username = 'yourusername';\r\n $phpmailer->Password = 'yourpassword';\r\n \r\n \/\/ Additional settings\u2026\r\n \/\/$phpmailer->SMTPSecure = 'tls'; \/\/ Choose 'ssl' for SMTPS on port 465, or 'tls' for SMTP+STARTTLS on port 25 or 587\r\n \/\/$phpmailer->From = \"you@yourdomail.com\";\r\n \/\/$phpmailer->FromName = \"Your Name\";\r\n}\r\nadd_action( 'phpmailer_init', 'my_phpmailer_example' );<\/code><\/pre>\n\n\n\n
Get Support:<\/h2>\n\n\n\n