Jump to content

Recommended Posts

Posted

Hola Zoneros, 

En el día de hoy me he fijado que GMAIL, ya no permite el acceso de aplicaciones menos segura. Muchos os preguntareis bueno como nos influye

image.png

 

Mucho de nosotros utilizamos la página web de https://metin2cms.cf/ con diferentes diseños, pero el código de PhpMailer seguramente sea el mismo, por lo que ya no se puede utilizar el gmail para la recuperación de contraseñas o las interacciones del usuario con la web. Otra opción es que se puede utilizar el mismo servidor (host) como emisor de los correos pero esto da problemas a la larga como meter la ip del hosting como spam o que muchos servidores de correo rechacen los mensajes, pero estuve indagando y encontré sendinblue.com, como sustituto de gmail. Lo he probado y la verdad que da buenos resultados, mandan los correos como promoción y ya no te chapan la ip del hosting como spam. Dejo la configuración de sendinblue para estas páginas webs de cms, si alguien necesita ayuda de como configurar la api que lo diga y amplio el mensaje.

    $SMTPAuth = true;
    $SMTPSecure = "tls";
    $EmailHost = "smtp-relay.sendinblue.com";
    $emailPort = 587;

Un saludo!

  • 7 months later...
  • 7 months later...
Posted

 

En 26/1/2023 a las 3:43, Mt2Mocoa dijo:

alguien tiene una guia de como crear me aparece esto error porfavor necesito una guia porfa

image.png

Te dejo un código de ejemplo para poder enviar un correo SMTP desde Brevo (anteriormente sendinblue)

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new Brevo\Client\Api\TransactionalEmailsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$sendSmtpEmail = new \Brevo\Client\Model\SendSmtpEmail([
  	 'subject' => 'from the PHP SDK!',
     'sender' => ['name' => 'Sendinblue', 'email' => '[email protected]'],
     'replyTo' => ['name' => 'Sendinblue', 'email' => '[email protected]'],
     'to' => [[ 'name' => 'Max Mustermann', 'email' => '[email protected]']],
     'htmlContent' => '<html><body><h1>This is a transactional email {{params.bodyMessage}}</h1></body></html>',
     'params' => ['bodyMessage' => 'made just for you!']
]); // \Brevo\Client\Model\SendSmtpEmail | Values to send a transactional email

try {
    $result = $apiInstance->sendTransacEmail($sendSmtpEmail);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TransactionalEmailsApi->sendTransacEmail: ', $e->getMessage(), PHP_EOL;
}
?>

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies to enhance your browsing experience and provide relevant content. By continuing to browse, you agree to our We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. and Terms of Use. For more information on how we protect your data, please check our Privacy Policy.