Jump to content

how to check the basic e-mail-settings in Wordpress: what needs to be met ?


dil_bert

Recommended Posts

i run a plugin called participant-databaae  ( https://wordpress.org/plugins/participants-database/ )

with this plugin i have the option to send mails to users.

but this does not work: i saw a page - email troubleshooting
https://xnau.com/work/wordpress-plugins/participants-database/participants-database-email-troubleshooting/

question: what is needed to make sure that the e-mail-settings are well and up and running

in other words: how to make  sure that the e-mail prerequisites are all met and fully work well


 i need to know what is needed to have all e-mail-settings in wordpress up.
 
 love to hear from you
 
 regards
 

Link to comment
Share on other sites

hello dear experts

note: there are some options to run a smtp-mail-plugin

i have found one: https://www.siteground.com/tutorials/wordpress/use-smtp/

By default, WordPress uses the PHP Mail function to send its emails. However it is better to use SMTP as it handles sending messages better and you can also use it to send emails from a third party mailing service.To begin, first you need to install a plugin named WP Mail SMTP by following the instructions in our tutorial on how to install WordPress plugins. Once the plugin is installed and activated, a new menu will show up under the Settings section called Email. You will need to navigate to it in order to configure WordPress to work with SMTP.

well – with this smtp-plugin i can do alot: Here’s a list of all of them and what do they configure:
 

    From Email – the email address you want to send emails from – for example email@yourdomain.com;
    From Name – the name that your emails will be sent from;
    Mailer – choose whether you want to use the default Mail function or the SMTP;
    Return Path – check if you want to match the return path for your emails to the sending email;
    SMTP Host – the hostname for your SMTP server;
    SMTP Port – the port your server works on;
    Encryption – if you have SSL/TLS encryption available for that hostname, select it here;
    Authentication – check if your SMTP server requires authentication;
    Username – the username for your SMTP server;
    Password – the password for your SMTP server;

 

Once you configure those parameters, simply click the Save button at the bottom of the page.

but wait: i want to know if it is possible to run with the basic e-mail-settings… how to check them!? What to do to get to know if the e-mail settings correct….



but - above all; i think that - in general we need  to have PHPMail up and working.
if we want to  do this with SMTP we need the following basic parameter,

 

outgoing-server,
Port,
username,
Passwort,
encryption

 

 

 

well i need to chek if the basic settings are well - so that mails can be sent

 

guess that i can do this with a view on the info-php settings , can´t i!?

Link to comment
Share on other sites

hello dear PHP-Freaks

 

update: these data below – i have taken out of the configuration on the php


sendmail_path    /bin/true    /bin/trueserialize_precision    17    17short_open_tag    Off    OffSMTP    localhost    localhostsmtp_port    25    25sql.safe_mode    Off    Offsys_temp_dir    /tmp    /tmptrack_errors    Off    Off

 

 

are there more Essentials and configuration-details that have to be met on the SERVER
in other words – do i have to take care for ___more___ configuration-details on the server!?

which are the important SERVER-Parameters for EMail? 

 

 

when i get all right then i have to

 

 

a. take care that the preliminary configurations are met on the Server – and then
b. i go to the Backend of WP and have a look at the Konfigurationens for the mailing…+

is this correct!?

 

 

love to hear from you

 

 

yours dil_bert

 

Link to comment
Share on other sites

update: Changing the WordPress email “from” address without a plugin

 

probably this may help me: 

 

WordPress relies on a function called wp_mail() to send email.  
chad Butler has tought me some ways to fix the malfunction of the wp_mail() he has created a function: This function is essentially a wrapper for the phpmailer class.  
if wp_mail default email “from” address cannot be configured via the WordPress admin panel there is a solution.  


this function and its related functions are both pluggable and can be filtered.  

Chad has creted a simple filter.

wp_mail() relies on some other outside information, some of which is wp_mail_from (an email address) and
wp_mail_from_name (the real name given to the email address).  

Chad: Since cheap levitra that is all we want to change, we are just going to filter those.
Filtering the email address

Add a filter for the email address using ‘add_filter’:
add_filter( 'wp_mail_from', 'my_mail_from' );
function my_mail_from( $email ) {
    return "change-this-to-your-email-address";
}

Filtering the email name

Now add a filter for the name of the email address:

add_filter( 'wp_mail_from_name', 'my_mail_from_name' );
function my_mail_from_name( $name ) {
    return "My Name";
}

The functions.php file

chad advices to add these two filters and their accompanying functions to the theme’s functions.php file.  

he states:

- go to the Appearance > Editor menu in the WP Admin Panel,
- then find ‘functions.php’ in the list of theme files on the right.  
- Add these filters and you are done

see more infos at: http://www.butlerblog.com/2011/07/08/change-wordpress-email-from-address-without-a-plugin/

 

probably this may help me:  i will try this out

Link to comment
Share on other sites

  • 1 year later...
  • 2 years later...

dear comunity 

 

.... years later i am facing issues - with a new and fresh install,  i guess that i have to recapitulate and to "revisite" the old taks - in order to get done all the steps to configure the settings - especially the e-mail-settings. 

 

pm a fresh installed wp - the newest version 5.6  i ve got an Error:

Quote

The email could not be sent. Your site may not be correctly configured to send emails. Get support for resetting your password.

 

background: with a new project i want to make sure, that works all propper and is set up correctly. 

so i just wanted to check the e-mail-setting of the server. i have heard that there are appropiate ways and methods to check mail functions. 

 

Well to check whether an email is sent out - we can do this with simple methods: a good and nice option is the following: we can do this by doing a password-reset-email: ;) 

well, by far the :easiest method to check:  if WordPress can send email is to request a password reset. To do this, we have to make sure to log out of the account on the site and go to the login page, e.g. like so: go the wordpress-page.il/wp-login.php

if we arrive on that page we just click the following notion “Lost your password?” text:
then we will arrive on the next page, here we can add our e-mail address of the according user account and demand our new passwd:
a texts pops up: “Get New Password.”

last step: if  get the new passwd - then the system works propperly.


but i do not get any password mailed - instand of this i get the message: 

Error: The email could not be sent. Your site may not be correctly configured to send emails. Get support for resetting your password.

further checks: to do more tests to check if wp_mail is working properly if i have configured the server correctly? in other words: i want to check whether an email is sent out using: 


what is important here:  The php.ini has smtp_port = 25 set - this i have checked. 


What can i do now - what should i do - which steps should i take!?

 

 

 

Link to comment
Share on other sites

dear friends 

 

dear Jamesbrown - good day hope youre well and all goes all right at your hometown. Hope that your town is dealing well with the covic-19 things. 

i did some further tests:  and i runned some scripts in order to test the the mail-functions oft he sever


by the way and on a sidenote: i also checked some things in the php.ini: The php.ini has smtp_port = 25 set
but this function - we do not need for our checks...  at the moment. .


below some of the tests - / note i tested some scripts -... all of them see below - with the results

mailtest10.php: Test-results: email sent - but no mail received at my inbox
taken from: https://conetix.com.au/support/simple-php-mail-test/

<?php 
    ini_set( 'display_errors', 1 );
    error_reporting( E_ALL );
    $from = "My_testmai_adress_@mywebserver.com";
    $to = "My_testmai_adress_@mywebserver.com";
    $subject = "PHP Mail Test script";
    $message = "This is a test to check the PHP Mail functionality";
    $headers = "From:" . $from;
    mail($to,$subject,$message, $headers);
    echo "Test email sent";
?>


<<<<<<<<<<<<<<<<<<

mailtest20.php: Test-results: Error: Message not accepted

taken from: https://www.arclab.com/en/kb/php/how-to-test-and-fix-php-mail-function.html

<?PHP
$sender = 'My_testmai_adress_@mywebserver.com';
$recipient = 'My_testmai_adress_@mywebserver.com';
	$subject = "php mail test";
$message = "php test message";
$headers = 'From:' . $sender;
if (mail($recipient, $subject, $message, $headers))
{
    echo "Message accepted";
}
else
{
    echo "Error: Message not accepted";
}
?>


 

<<<<<<<<

mailtest30.php: Test-results: Testing PHP mail - this text was shown up

taken from: https://tekeye.uk/html/php-mail-script-for-testing-email-sending

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>PHP Mail Test</title>
    </head>
    <body>
        <h1>Testing PHP mail</h1>
        <?php
            //Use your test email address
            $to      = 'My_testmai_adress_@mywebserver.com';
            //Use an appropriate email subject
            $subject = 'A Test Email';
            $message = 'The quick brown fox jumped over the lazy dog. Then the fox jumped over the dog again.';
            //wordwrap long content
            $message = wordwrap($message, 70, "\r\n");
            $headers = 'From: some.body@example.com';
            //Send the email
            if(mail($to, $subject, $message, $headers))
            {
                echo 'Email sent out';
            }
            else 
            {
                echo '<pre>';
                print_r(error_get_last());
                echo  '</pre>';
            }
        ?> 
    </body>
</html>
	

 


Well - now i will have a closer look at the server-conditions.

btw - besides the various scripts i found some other ressoruces that cover the topic-mail-deliverability and sending mails from a server: here i found a with explanaitions
 

- on a sidenote  with explanaitions i found a great and a very interesting site that reveals lots of information for mail-deliverabilty  see  https://stackoverflow.com/questions/24644436/php-mail-function-doesnt-complete-sending-of-e-mail
 

interesting points here are some of the following:


Make sure mail headers have no syntax errors
Invalid headers are just as bad as having no headers. One incorrect character could be all it takes to derail your email. Double-check to make sure your syntax is correct as PHP will not catch these errors for you.

$headers = array("From from@example.com", // missing colon
    "Reply To: replyto@example.com",      // missing hyphen
    "X-Mailer: "PHP"/" . PHP_VERSION      // bad quotes
);


Enable PHP's custom mail.log
In addition to your MTA's and PHP's log file, you can enable logging for the mail() function specifically. It doesn't record the complete SMTP interaction, but at least function call parameters and invocation script.

ini_set("mail.log", "/tmp/mail.log");
ini_set("mail.add_x_header", TRUE);


See http://php.net/manual/en/mail.configuration.php for details. (It's best to enable these options in the php.ini or .user.ini or .htaccess perhaps.)


Make sure your form action value points to the correct location

see  more here: https://stackoverflow.com/questions/24644436/php-mail-function-doesnt-complete-sending-of-e-mail

Link to comment
Share on other sites

due to some hints we are aware of risks that are combined with php mail

 

cf https://blog.ripstech.com/2017/why-mail-is-dangerous-in-php/

Quote

Why mail() is dangerous in PHP....that based on insecure usage of the PHP mail() 
function. ...these vulnerabilities and how to use mail() securely.

summary: 
..we have highlighted the risks of the 5th mail() parameter and how to protect 
against attacks that can result in full server compromise.

that said - my admin ( a pure-security nerd ) turned of the mail_()-function: we run a pear package on the server. i now use smtp - and this works perfectly. 

i use this smtp-plugin: https://de.wordpress.org/plugins/wp-mail-smtp/ this works great.
 

Edited by dil_bert
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

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.