Your host may have disabled the mail function

New Page

WordPress se niega a enviar correo, “… su host puede haber deactivado la función de correo ()”

Pregunta

Preguntó hace 9 years, 5 months

Modified 1 year, 7 months ago

Visto 96k times

This question shows research effort; it is useful and clear

12

This question shows no research effort; it’s not clear or not helpful

ten

Bookmark this question.

View activity on this post.

Recently implemented a comment area in my web site and intended that the notification by correo electronic function. No because querer enviar notificaciones por correo electrónico cuando se hacen nuevos comentarios.

Solo para ver si PHP can enviar correos electrónicos, traté de restablecer la contraseña (porque recibirá una nueva contraseña por correo) y recibí el mensaje:

No se pudo enviar el correo electrónico. Possible reason: it is possible that the host has disabled the mail() function

Revised the verification cases in Configuration -> Discusión y el correo electrónico es valido, por lo que no es un problema de configuration. Intend to create a PHP archive and use mail(), and send it correctly. While debe haber algo raro con WordPress.

¿Ideas Algunas?

  • php
  • wp mail
  • E-mail

To share

Share a link to this question

Copy link CC BY-SA 4.0

Mejora esta pregunta

Seguir

Sigue esta pregunta para recibir notifications

edited on May 11, 2019 at 8:25 PM

butlerblog user avatar

butler blog

4,460 3 3 gold badges 23 23 silver badges 39 39 bronze badges

asked on April 8, 2013 at 2:23 p.m.

qwerty user avatar

qwerty qwerty

655 5 5 gold badges 13 13 silver badges 23 23 bronze badges

1

  • Please provide debug information

    – s_ha_dum

    April 8, 2013 at 3:12 PM

Add a comment | 

10 answers10

Ordenado por: Restablecer a predeterminado

Puntaje más alto (predeterminado) Fecha de modificación (más recente primero) Fecha de creación (primero el más antiguo)

This answer is helpful

9

This answer is not helpful

View activity on this post.

Paso a paso: Primero busque el archivo donde aparece el mensaje de error. Use Notepad++ and command CTRL+ Fpara buscar en archivos. Es una buena idea buscar solo las primeras palabras del mensaje de error, y que algunos mensajes de error se combinan con diferentes mensajes.

Su mensaje de error aparece en wp-login.phpy santa suerte, solo allí. Así que echemos un vistazo por qué podría ocurrir este error.

if ( $message && !wp_mail($user_email, $title, $message) )

Hay dos conditions. $messagetiene que ser verdadero (no una cadena vacía, no falsa, no nula, etc.). Y wp_mail() ne debería devolver falso.

Una línea más arriba, hay un filtro $message = apply_filters(‘retrieve_password_message’, $message, $key);, por lo que es posible que un complemento (o tema) use este filtro y devuelva un valor que no es verdadero (cadena vacía, falso, nulo, etc.).

Pero es mucho más fácil comprobar si wp_mail()funciona o no. Escribe un pequeño complemento para enviarte un correo de prueba a ti mismo:

<?php /** * Plugin name: Stackexchange Testplugin * Plugin URI: http://yoda.neun12.de * Description: Send me a test email * Version: 0.1 * Author: Ralf Albert * URI from author: http:// yoda.neun12.de * Text domain: * Domain path: * Network: * License: GPLv3 */ namespace WordPressStackexchange; add_action(‘init’, __NAMESPACE__.’\plugin_init’); function plugin_init(){ $to = ‘[email protected]’; $subject = ‘Test-mail’; $message = ‘FooBarBaz Testmail is working’; wp_mail( $to, $subject, $message ); }

(Is the PHP5.3 código. If you are running PHP5.2, eliminates the cosas del space of numbers)

El complemento debe enviar a correo de prueba immediately after the activation. If not, llamar a algunas páginas de back-end (por ejemplo, tablero) debería hacerlo.

If the testmail doesn’t arrive, then you probably have a problem with wp_mail(). So enable debugging:

set( ‘WP_DEBUG’, true ); set( ‘WP_DEBUG_LOG’, true ); set( ‘WP_DEBUG_DISPLAY’, true ); @ini_set(‘display_errors’,1);

Put this code in your wp-config.php and try to send yourself a testmail again. You should now get some error messages and they should also be logged to wp-content/debug.log (the debug log can get very large if there are more errors caused by plugins and/or themes ).

À ce stade, vous avez de bonnes informations si wp_mail() échoue et si oui, pourquoi. Si wp_mail() fonctionne correctement et que le testmail est arrivé, revenez en haut et découvrez pourquoi $message n’est pas vrai.

Si vous rencontrez des problèmes avec wp_mail(), gardez à l’esprit que wp_mail() n’utilise pas la fonction PHP mail(). WordPress utilise une classe PHP (PHPMailer). Peut-être avez-vous juste besoin d’un plugin pour utiliser SMTP au lieu de sendmail. Soit le problème se situe à un autre endroit. Nous ne savons pas. Vous devez enquêter.

Partager

Partager un lien vers cette réponse

Copier le lien CC BY-SA 3.0

Améliorer cette réponse

Suivre

Suivez cette réponse pour recevoir des notifications

modifié le 11 décembre 2014 à 1:25

Simon East user avatar

Simon Est

191 8 8 insignes de bronze

répondu le 8 avril 2013 à 15:44

User avatar from Ralf912

Ralf912 Ralf912

5 229 1 1 gold badge 20 20 silver badges 36 36 bronze badges

5

  • Yeah i tried digging into the core and it also lead me to PHPMailer, and it actually does use php’s mail(). At least in some cases (see line 732 in wp-includes/class-phpmailer.php. I don’t have access to the ftp atm but i will try your suggestions as soon as i can. Surely this must lead me somewhere. Thanks a lot!

    –qwerty

    Apr 8, 2013 at 5:52 pm

  • I tested wp_mail() and it seems to work fine, i received the mail as expected. WP still wouldn’t send the comment/password-reset emails though, and i didn’t get anything in the log file (it wasn’t created), so i tried installing an SMTP mail plugin and set up a new email account for WordPress. It works now but i still don’t understand why it couldn’t send before. Thanks!

    –  qwerty

    Apr 9, 2013 at 7:05

  • I’m not getting any error and even not mail

    –  baldraider

    Aug 19, 2017 at 7:29

  • Where to save your plugin ?

    –  Black

    Nov 4, 2021 at 9:19

  • As you can see, the answer is about 8 years old. I have not worked with WordPress more than 5 years. As incan remember, in the wp-plugins dieectory, ascusual. But maybe things was changed in the last 5 years.

    –  Ralf912

    Nov 4, 2021 at 13:30

Add a comment  | 

This answer is useful

2

This answer is not useful

Show activity on this post.

This is a super annoying error message as it could be many things, and it doesn’t reveal the actual error (which is often silenced in other parts of the code).

This error appears when the wp_mail() function returns false, which in turn could happen if phpmailer->Send() returns false or raises an exception.

How to display warnings from PHP’s mail() function

Celles-ci sont normalement réduites au silence par défaut, mais malheureusement, WordPress ne les capture jamais. Pour les afficher, supprimez simplement les signes @ de @mail(… dans wp-includes/class-phpmailer.php dans la fonction mailPassthru() :

if (ini_get(‘safe_mode’) || !($this->UseSendmailOptions)) { $rt = @mail($to, $this->encodeHeader($this->secureHeader($subject)), $body, $ on your mind); } else { $rt = @mail($to, $this->encodeHeader($this->secureHeader($subject)), $body, $header, $params); } How to track down other possible causes:

  1. Add a single line at the bottom of wp_mail() in /wp-includes/pluggable.php:

    // Send! try { return $phpmailer->Send(); } catch ( phpmailerException $e ) { //————- This next line is the one to add ——————- if (WP_DEBUG) echo ‘<pre>’ . esc_html(print_r($e, TRUE)) . ‘</pre>’; return false; }

  2. It will dump the full details of where the exception was raised. Unfortunately it sometimes includes this unhelpful exception message: “Could not instantiate mail function”. Yeah thanks WordPress, that’s real helpful.

  3. By looking at the exception you can find the line number of the error, and can hopefully trace it back through the code to find the real cause.

Good luck. Hopefully WordPress improves email error handling at some point in the future.

Share

Share a link to this answer

Copy link CC BY-SA 3.0

Improve this answer

Follow

Follow this answer to receive notifications

répondu le 11 décembre 2014 à 0:08

Simon East user avatar

Simon Est Simon Est

191 8 8 insignes de bronze

Ajouter un commentaire | 

Cette réponse est utile

2

Cette réponse n’est pas utile

Afficher l’activité sur ce post.

I have the same problem with Ubuntu server on Amazon EC2. I have a problem when using password reset link and other notification emails were not working.

So here are some solutions that worked for me. Word-press used the wp_mail() function to send emails that required the PHPMailer class which used php mailer stored in /usr/sbin/sendmail.

First use this simple php function to check php mail

<?php $to = “[email protected]”; $subject = “Test the e-mail function”; $txt = “Hello world!”; $headers = “From: [email protected]” . “\r\n” . “CC: [email protected]”; mail($to,$subject,$txt,$headers); ?>

If that doesn’t work, you need to install php mailer. Use this command to install php mail on Ubuntu server.

sudo apt-get install sendmail

Next, check wordpress email functions.

To share

Share a link to this answer

Copy link CC BY-SA 3.0

Improve this answer

Follow

Follow this answer to receive notifications

answered on May 3, 2017 at 6:34 am

CyberAbhay User Avatar

CyberAbhay CyberAbhay

121 1 1 silver badge 4 4 ​​bronze badges

1

  • this answer is the one everyone should try before any other answer, this is the way to go

    – to hate

    Jan 25, 2019 at 12:53 PM

Add a comment | 

This answer is helpful

1

This answer is not helpful

View activity on this post.

If the other good answers here don’t help, try this:

J’ai rencontré ce même problème et rien de ce que j’ai pu trouver dans aucune des suggestions pour WordPress ne l’a résolu pour moi.

Then I started investigating if it was the PHP installation itself that had disabled the mail function, but none of that worked either. Everything looked like it was configured properly.

All of these problems started for me once I upgraded my server to CentOS 7 which uses SELinux (Security Enhanced Linux) and what I’ve learned in the last couple of weeks with SELinux is that if something isn’t working, but everything looks like it should be working… that means SELinux is silently and secretly blocking you in the background.

And viola.

If you are running and OS that uses SELinux, just execute the following command as root:

setsebool -P httpd_can_sendmail=1

There is a security setting that inherently prevents the webserver from sending email. When you flip that switch and tell SELinux it’s ok for the webserver to send email, everything suddenly works.

Share

Share a link to this answer

Copy link CC BY-SA 3.0

Improve this answer

Follow

Follow this answer to receive notifications

answered Feb 4, 2017 at 19:24

Kenny Wyland user avatar

Kenny Wyland Kenny Wyland

201 2 2 silver badges 9 9 bronze badges

Add a comment  | 

This answer is useful

0

This answer is not useful

Show activity on this post.

I ran into this today; in my case the situation happened because the server’s hosts file has the same domain name of the email address, pointing to localhost. The mx record points to a different server, but the hosts file is overriding DNS and WP is trying to deliver the email locally. Removing the domain from the hosts file and restarting sendmail resolved this issue.

Share

Share a link to this answer

Copy link CC BY-SA 3.0

Improve this answer

Follow

Follow this answer to receive notifications

answered Jan 16, 2014 at 19:15

User avatar of user16081

user16081 user16081

186 7 7 bronze badges

Add a comment  | 

This answer is useful

0

This answer is not useful

Show activity on this post.

I don’t know whether this is still relevant to you or not, but since there is no answer chosen, I thought let me give it a try once.

Actually, I had faced the exact same problem since my openshift host all of a suddenly gave way today and stopped sending mails. Digging through the code and codex, I came to know about the wp_mail() function and finally google led me here and I saw how it could be overridden.

Building on @Ralf912’s answer, I modified the script a bit so that the code uses sendgrid.com’s web api to send mails instead of wordpress default one (that I presume :

<?php function sendgridmail($to, $subject, $message, $headers) { $url = ‘https://api.sendgrid.com/’; //$user = ‘your username’; //$pass = ‘your password’; $params = array( ‘api_user’ => $user, ‘api_key’ => $pass, ‘to’ => $to, ‘subject’ => $subject, ‘html’ => ”, ‘text’ => $message, ‘from’ => ‘[email protected]’, ); $request = $url.’api/mail.send.json’; // Generate a curl request $session = curl_init($request); // Tell curl to use HTTP POST curl_setopt ($session, CURLOPT_POST, true); // Tell curl this is the POST body curl_setopt ($session, CURLOPT_POSTFIELDS, $params); // Tell curl not to return headers, but return response curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // get the response $response = curl_exec($session); curl_close($session); // print everything //print_r($response); } //only for testing: /*$to = ‘[email protected]’; $subject = ‘Test-mail’; $message = ‘It works !!’; echo ‘To is: ‘ + $to; #wp_mail( $to, $subject, $message, array() ); sendgridmail($to, $subject, $message, $headers); print_r(‘Just sent!’);*/ if (!function_exists(‘wp_mail’)) { function wp_mail($to, $subject, $message, $headers = ”, $attachments = array()) { // use the GnuPG PHP library here to send mail. sendgridmail($to, $subject, $message, $headers); } } function plugin_init() { /* $to = ‘[email protected]’; $subject = ‘Test-mail’; $message = ‘ It works live!’; //echo ‘To is: ‘ + $to; wp_mail( $to, $subject, $message, deploy() ); //print_r(‘Just sent!’);*/ }

Et ça a marché !

Partager

Partager un lien vers cette réponse

Copier le lien CC BY-SA 3.0

Améliorer cette réponse

Suivre

Suivez cette réponse pour recevoir des notifications

répondu le 30 mai 2014 à 17:04

User avatar of Prahlad Yeri

Prahlad Yeri Prahlad Yeri

113 6 6 insignes de bronze

Ajouter un commentaire | 

Cette réponse est utile

0

Cette réponse n’est pas utile

Afficher l’activité sur ce post.

J’ai eu la même erreur, les deux fonctions (mail et wp_mail) fonctionnaient, mais j’avais toujours cette erreur ennuyeuse. La solution a été très simple, mais il m’a fallu quelques heures pour trouver la raison. Je vais donc partager ici ma solution au problème qui pourrait être (ou non) la même que la vôtre.

I tried the mail() function and it worked, but when you test it you don’t specify the last parameter called ‘parameters’ in the mail() function. And WP uses it.

@mail(“[email protected]”,$title,$body,$headers,”[email protected]”);

So, basically, this parameter (“[email protected]”) with flag “-f” makes mail() function check if the email address “[email protected]” listed in the “trusted emails” list.

So if it doesn’t, it returns false, which makes wp_mail() returns false and leads to the error message.

So, solution is to ask hoster to do this for you, or if you are using cPanel, just add email account for this address and it will automatically will add it into the “trusted list”.

Share

Share a link to this answer

Copy link CC BY-SA 3.0

Improve this answer

Follow

Follow this answer to receive notifications

answered Aug 23, 2016 at 12:16

User avatar of user3696815

user3696815 user3696815

1

Add a comment  | 

This answer is useful

0

This answer is not useful

Show activity on this post.

it called -Manage Registered Email-Ids For Sending Mails via Scripts ie.(WordPress)

  1. Login your Cpanel.
  2. Go to Email Section > then Click Registered Email IDs.
  3. then add ([email protected]) or where your wordpress hosted. ie ([email protected]) . then submit, it takes few minute to activate wait 15minute to 1 hour depending to your hosting provider, then it will work.

Share

Share a link to this answer

Copy link CC BY-SA 4.0

Improve this answer

Follow

Follow this answer to receive notifications

answered May 31, 2019 at 17:03

Amrit Bhandari user avatar

Amrit Bhandari Amrit Bhandari

1

Add a comment  | 

This answer is useful

0

This answer is not useful

Show activity on this post.

I had this error for ages and tried so many solutions that didn’t work. I have a custom WordPress install on AWS EC2. First off ensure your AWS SES mail is enabled through support, they must be in the same (or close) region in SES and EC2. I used Google suite(gsuite) for email for receiving/sending mail.

Make sure the test email sends in AWS SES and Gsuite.

Install the WordPress plugin WP Mail SMTP, use the option “Other SMTP”, grab your SMTP credentials from AWS SES, this is where I got stuck.

You must enable the tick box “SSL” for Encryption, this changes the port to 465 for me. At last my email test sent from Worpdress successfully.

Share

Share a link to this answer

Copy link CC BY-SA 4.0

Improve this answer

Follow

Follow this answer to receive notifications

edited Dec 16, 2019 at 19:12

answered Dec 14, 2019 at 15:16

Archie Butler Avatar

Archie Butler Archie Butler

103 5 5 bronze badges

Add a comment  | 

This answer is useful

0

This answer is not useful

Show activity on this post.

I fixed this issue by changing the “From Email” on my local test environment, by changing it from [email protected] to [email protected], for example using a WordPress plugin like “WP Mail SMTP” and selecting the default PHP mailer instead of using SMTP.

The issue happened even with all other plugins disabled and I did not have this issue in the past. The issue is also not present when using the PHP mail function directly, so maybe it happened because of a recent WordPress change.

I sent and received emails on my local computer using Postfix.

Share

Share a link to this answer

Copy link CC BY-SA 4.0

Improve this answer

Follow

Follow this answer to receive notifications

answered on February 26, 2021 at 12:14 PM

baptx user avatar

baptx baptx

111 5 5 bronze badges

Add a comment | 

Your answer

Thanks for contributing a response to WordPress Development Stack Exchange!

  • Please be sure to answer the question. Provide details and share your research!

But avoid…

  • Ask for help, clarification, or respond to other responses.
  • Make statements based on opinion; back them up with references or personal experience.

To learn more, check out our tips for writing great answers.

Saved Draft

Draft rejected

Sign up or log in

Sign up with Google

Sign up using Facebook

Sign up using your email and password

Submit

Post as guest

Last name

E-mail

Required, but never displayed

Post as guest

Last name

E-mail

Required, but never displayed

Post your answer Ignore

By clicking “Post your answer” you agree to our Terms of Service, Privacy Policy and Cookies Policy

Not the answer you are looking for? Browse other tagged questions

  • php
  • wp mail
  • E-mail

or ask your own question.

  • The overflow blog
  • Ethereum finally merges, semiconductors remain scarce (Ep. 490)

  • Stack Overflow Trends: Weekday vs. Weekend Site Activity

  • Featured on Meta
  • Recent color contrast changes and accessibility updates

Related

5

Customize Subject field in WordPress notification emails?

1

3 different email notifications

2

wp_mail recipient array not sending?

0

How to send an email with wp_mail() with an email retrieved from the contact form instead of the host?

0

WP Mail does not send user account messages, sends plugins

1

WordPress unable to send mail

3

How to send mail with custom form data using WordPress

0

Does WordPress require port 25 for email?

Network burning questions

  • What is it called and what causes it? Bright reflections along the contrasting edges
  • How to politely ask a professor if you can work under them as a contingency plan?
  • How do non-English speakers navigate through JFK airport?
  • How to get the Lilim to breed true?
  • How do I solve this sudoku without guessing
  • What is the order of magnitude of water-wave pressure as compared to that of a typical animal communication sound?
  • How important is to have many gears on a e-bike?
  • Why did ‘scp 10.0.0.11:/home/someuser/.*’ start copying from /home as well?
  • How do custom indexes impact performance negatively?
  • How can I measure the actual amperage rating of my circuits so I can match it with correct fuses/breakers?
  • How to indicate to the user that they haven’t completed a prerequesite?
  • Trying to identify a novella by Poul Anderson
  • Can the princess escape using shoddy craftsmanship in a one-sided lock?
  • Does the key a piece is written in affect playability for piano?
  • Found a mistake in a published paper at IEEE Transactions on Industrial Informatics
  • AIC for nested models: is the AIC of a smaller model A always smaller than that of the nesting model B?
  • Living room breaker will not turn on after pressure wash
  • Are academic groups allowed to use grant funds to hedge against forex changes?
  • Looking for a science fiction short story about aliens harvesting heat from a probe
  • Reasons to untrust Let’s Encrypt certificates
  • Is there a way to compute the spectrum effect of a non-linear function?
  • How many ways to arrange 18 students and 2 teachers with 8 students between the 2 teachers
  • Converting 24 VAC to 5 VDC with small output current
  • Any tips on writing scenes between characters where there is no action?

Question feed

Subscribe to RSS

Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

How to send e-mail in WordPress

This article describes how to configure WordPress to send e-mail messages using SMTP authentication. You can use a third-party WordPress plugin to do this, or you can write your own code in a custom WordPress plugin.

Table of Contents

  • Method #1: Using a third-party plugin
    • Installing the WP Mail SMTP plugin
    • Configuring the WP Mail SMTP plugin
  • Method #2: Using the WordPress API
  • More Information

Method #1: Using a third-party plugin

There are many WordPress plugins that provide e-mail functionality. One of the most popular and well-known plugins is WP Mail SMTP, which enables you to configure e-mail settings that are compatible with A2 Hosting servers.

Installing the WP Mail SMTP plugin

To install the WP Mail SMTP plugin, follow these steps:

  1. Connectez-vous à votre site WordPress en tant qu’administrateur.
  2. Dans le volet de gauche, cliquez sur Plugins.
  3. Cliquez sur Ajouter nouveau.
  4. In the Search Plugins text box, type mail smtp, then press Enter.
  5. Locate WP Mail SMTP by WPForms, then click Install Now.
  6. Once WordPress has finished installing the plugin, click Activate.
WP Mail SMTP Plugin Setup

To configure the WP Mail SMTP plugin to work with your account, follow these steps:

  1. Log in to your WordPress site as an administrator.
  2. In the left pane, click WP Mail SMTP, then click Settings. The WP Mail SMTP general settings page appears.
  3. In Correo , in el cuadro de texto De correo electrónico , write the direction of correo electrónico that desea usar como remitente.

    This dirección de correo electrónico debe existir en su cuenta.

  4. In the cuadro de texto Numéro del remitente, write the number that you want to associate with the direction of the electronic correo that especificó in step 3.
  5. In Route of retorno, select the casilla Establecer the route of retorno para that coincides with the casilla of verification Desde el correo electrónico.
  6. In Mailer, select Otro SMTP.
  7. In Otro SMTP , in el cuadro de texto Host SMTP , write the complete number of the server para su cuenta.

    To obtain information sober how to determine the number of the servant of his cuenta, consult this article.

  8. Elija one of the following configurations:
    • If you use el cifrado, in el cuadro de texto Puerto SMTP , write 465 y luego, in Cifrado , select SSL .
    • If you don’t use el cifrado, en el cuadro de texto Puerto SMTP , escriba 25 y luego, en Cifrado , seleccione Ninguno .

    A2 Hosting recommends that you use the cifrado as much as possible.

  9. In Autenticación, select Activado.
  10. In the cuadro de texto Number of usuario SMTP , write the direction of correo electrónico that especificó in el paso 3.
  11. In el cuadro de texto Contraseña SMTP , write the contraseña of the cuenta de correo electrónico that especificó in el paso 10.
  12. Haga click in Guardar configuration.

    Debe probbar the new configuration to asegurarse de que funciona. Para hacer esto, siga estos pasos:

    • Haga click in the pestaña Prueba de correo electrónico y, a continuation, en el cuadro de texto Enviar a, escriba une dirección de correo electrónico externa valida donde pueda recbir un mensaje de prueba.
    • Click on Enviar correo electrónico . Debería recibir a mensaje de prueba in the direction of correo electrónico that especificó in el paso anterior. If no message is received, check the configuration that proporcionó en los pasos 3 a 11 y vuelva a intentarlo.

Method #2: Use the WordPress API

Using a third party complement to manage the electronic correo of your site, you can unlock your personalized code and use the wp_mail() function in the WordPress API.

El siguiente procedimiento demuestra cómo enviar mensajes de correo electrónico mediante la autenticación SMTP. El tema más amplio de cómo escribir un complemento está más allá del alcance de este artículo. For information on how to write a WordPress plugin, visit https://developer.wordpress.org/plugins.

To send electronic correo messages with SMTP authentication using the WordPress API, siga estos pasos:

  1. In the wp-config.php archive, copy and click on the following code: define(‘SMTP_HOST’, ‘servor.a2hosting.com’); // A2 Hosting server name. For example, “a2ss10.a2hosting.com” define(‘SMTP_AUTH’, verdadero); set(‘SMTP_PORT’, ‘465’); set(‘SMTP_SECURE’, ‘ssl’); define(‘SMTP_NUMBER OF USER’, ‘ [email protected] ‘); // Username for SMTP authentication define(‘SMTP_PASSWORD’, ‘contraseña ‘); // Contraseña para autenticación SMTP define(‘SMTP_FROM’, ‘ [email protected] ‘); // SMTP from direction define(‘SMTP_FROMNAME’, ‘Kelly Koe’); // SMTP From number
  2. Replace the values ​​in red with the configuration of your propio site and luego guarde los cambios en el archivo wp-config.php .
  3. In su archivo de código de complemento, copy y pegue el siguiente código:

    add_action(‘phpmailer_init’, ‘send_smtp_email’); function enviar_smtp_email ($ phpmailer) { $phpmailer->isSMTP(); $phpmailer->Host = SMTP_HOST; $phpmailer->SMTPAuth = SMTP_AUTH; $phpmailer->Puerto = SMTP_PORT; $phpmailer->SMTPSecure = SMTP_SECURE; $phpmailer->Number of users = SMTP_NUMBER OF USER; $phpmailer->Contrasa = SMTP_PASSWORD; $phpmailer->Desde = SMTP_FROM; $phpmailer->FromName = SMTP_FROMNAME; }

  4. To send an email message, call the wp_mail() function . For instance :

    wp_mail(“[email protected]”, “Asunto”, “Message”);

    There, WordPress will send the message using the SMTP authentication configuration that was set earlier.

More information

For more information on the WP-Mail-SMTP add-on, visit https://wordpress.org/plugins/wp-mail-smtp.


Video Your host may have disabled the mail function

Related Posts

Free chat room code for my website

Contents1 How to set up a free chat room on the website.2 3 comentarios2.1 Trackbacks/Pingbacks2.2 Submit a Comment Cancel reply3 How to Create a Chat Room Website…

Background image full screen css

Contents1 Cómo – Full Page Image1.1 Example1.2 Example2 CSS background image tamaño tutorial: how to codify a complete page background image3 Perfect Full Page Background Image3.1 Méthode CSS géniale,…

WordPress leverage browser caching

Contents1 Aproveche el almacenamiento in hidden del navegador1.1 Will it works for my website?1.2 Where are plugin options1.3 Some JavaScript files still display under Leverage Browser Caching1.4…

WordPress post to facebook page

Contents1 How to Automatically Post to Facebook from WordPress1.1 Download Now: How to Launch a WordPress Website [Free Guide + Checklist]1.2 1. Create an IFTTT account.1.3 2….

Download images from wordpress media library

Contents1 How to export your WordPress media library1.1 Download maintenant : How to launch a WordPress website [Free Guide + Checklist]1.2 How to export your WordPress media…

WordPress single post template

Contents1 How to Create Custom Unique Post Templates in WordPress2 Post Template Files2.1 author.php2.2 Fecha.php3 Handbook navigation4 How to Create Custom Single Post Templates in WordPress5 Video…