[resolved] Send mail using smtp without any plugin (3 posts)

  1. nandi.mrinal
    Posted 3 years ago #


    I just solved the smtp send mail problem from wordpress using a little bit coding. I didn’t used any plugin and didn’t found any configuration setting in wordpress for SMTP (I am new in WP). I did it for my gmail account.
    Here is the code snippet which I placed just bellow line no. 405 (with the content “$phpmailer->IsMail();”) and in the function “wp_mail” in wordpress_installation_folder/wp-includes/pluggable.php file.

    $phpmailer->SMTPAuth = true;
    $phpmailer->IsSMTP(); // telling the class to use SMTP
    $phpmailer->Host = “ssl://smtp.gmail.com”; // SMTP server
    $phpmailer->Username = ‘my.mail.id@gmail.com’;
    $phpmailer->Password = ‘placed_my_password_here’;
    $phpmailer->Port = 465;

    It worked fine for me and definitely will work for others, too.

    But my question is that, Is there any setting already for SMTP in the wordpress admin panel? Can anyone tell me plz?


  2. damirkajzer
    Posted 3 years ago #

    There is no setting for SMTP in the wordpress admin. Unfortunately, they left that part for users to encode themself. Probably because it is understood that each server on which the WP is installed have its own sendmail (usr / bin / sendmail) on localhost. But, there is lot of plugins that solve this mistery ;)

  3. damirkajzer
    Posted 3 years ago #

    just to add to your coding, you need to open the file smtp.php-class, class-phpmailer.php, pluggable.php and change some settings, the same ones you mentioned but each item must be in those files where it was written!

Topic Closed

This topic has been closed to new replies.

About this Topic