Mail Not Sending from My Server - email

I am having issues sending mail from my server, when I type in phpinfo() I get this:
Mail: /var/spool/mail/frank
...
_ENV["MAIL"]: /var/spool/mail/frank
The php file that I'm using the Mail function in is owned by Apache and has 775 permissions. Inside /var/spool/mail there is no apache file, but there is a file for every other user on the box. Do I need to change the php.ini? Or can I add in an apache file (perhaps duplicate the frank file and then rename)?
Any advice can help!

/var/spool/mail is where incoming unread mail is stored. There would be an 'apache' file only if the apache account has received mail.
Have you looked inside the MTA's log (usually /var/log/maillog) to see what's going on? If PHP's properly sending mail, there should be an entry in there for the mail being en-queued and what happened when the MTA (postfix/sendmail/exim/etc...) tries to forward it onwards.

Related

Thunderbird: Your message was sent but a copy was not placed in your sent folder

So I've been getting this error using Thunderbird with my Gmail account when trying to send emails:
Thunderbird: Your message was sent but a copy was not placed in your sent folder (Sent) due to network or file access errors. You can retry or save the message locally to Local Folders/Sent-
This is actually happening with all my Mail accounts and not just Thunderbird...
Things I have tried:
I changed the connection security on server settings from STARTTLS to SSL/TLS.
I tried changing THUNDERBIRD preferences editor security.tls.version.min from 3 to 1
Both didn't seem to work for me. Anyone have the same problem and found a solution to this?
Help menu -> turn troubleshoot mode on
this will disable all your addons and restart thunderbird in troubleshoot mode on.
This solved my problem.
go to settings /passwords/ note both SMTP and IMAP passwords , delete the registered passwords, restart Thunderbird enter the password again IMAP, then create a message Send it , it will prompt for SMTP password, enter it. That's it, it worked for me
I just reconfigured "Copies & Folders"
When sending messages, automatically:
Place a copy in:
(and selected "Sent" Folder on:)
Previously "Other" was selected (and worked just fine...)
This happened from one day to the other, with no update from Thunderbird... this is very very strange!

Moodle email not get even after a success message

I can't get user verification mail even after a success message. My file permission is 755. It show success message with or with out an smtp setting. I think problem arises after my server change. But php mail function is working when I tested in separate file on server.Any Idea about this problem.
Please install test email moodle plugin and test email using that plugin. it will show the error if email fail.

Magento 2.0.2 mail not sending

All Mail is not sending from Magento 2.0.2. Mail function is enabled. I tested in index.php file. while testing the PHP mail function like mail($to,$subject,$message, $headers) mail is not sending. I am using Ubuntu server. Let me know anything we need to configure in my php.ini file or any thing else.
You will have to set cron job first, because Magento does not send email without setting cron.
You can send email which is not Magento default email.But when you want to send all Magento default email like order email, shipment email, customer etc then you have set cron first.

Is it possible to send a email through Batch file

Is it possible to send an email through a batch command line? I have a password batch file for a folder and when you fail three attempts i want it to send me an email. I know its possible to download ans install a program off the internet but when I would open the program it would close. So is there a command or program that sends and email through batch?
TakeCommand will enable all kinds of commandline-magic, including sending of mail. Alkternatively, if you have a local install of PHP (and properly set it up), you could write a PHP-Script to send mail and launch the PHP-Interpreter (in your batch) to execute that file.

PHP mail() in dev environment: open the mail in a browser/editor instead of sending it?

On my machine I need to test the mails sent by my application. I'd rather avoid sending real mails.
Is there a way to have the email content showed to the screen a way or another, maybe by opening it in gedit or any text editor?
Maybe like replacing the commandline used to launch "sendmail"?
I am asking for Linux machines (Ubuntu more specifically).
Include a means of determining your environment in your project, or at least some kind of global variable that holds that information.
Then build an abstract mail interface that either sends real mails if it's running on a production server, but logs them to local files in case it runs on a dev machine / environment. As a logging package, I would recommend Monolog.
This would allow you to design the rest of your application (or at least the mail sending components) in a way that doesn't have to care about the environment.
After searching, here is the solution I came to:
create a script that will fake a smtp server
/usr/local/bin/sendmail-fake:
#!/bin/bash
{
date
echo $#
cat
} >> /var/log/sendmail-fake.log
configure PHP:
php.ini:
sendmail_path = /usr/local/bin/sendmail-fake
In this setup, emails are logged into a file. The script could be modified to open the content into a browser.
More details on the blog post.