issue sending magento order confirmation emails - php

we had an issue with our sendmail program recently. for some reason it wasn't working. i ended up fixing it, but we're still not receiving confirmation emails from the store. it doesn't give us an error (as far as i can tell), but it simply isn't sending. is there anywhere somebody could suggest i look to fix it? log files, PHP files, anything? i'm at a loss and i've been working on this for 2 days with no results. the client is getting more and more impatient.
the email user is receiving all other emails, the sendmail program is working properly, etc. I have no clue what could be wrong. can somebody at least point me in the right direction?

You can do the fallow steps to trouble shoot the problem
run this command in the server:
echo "This is a test." | mail -s Testing someone#somedomain.com
check is the email daemon is working
check the email log server at /var/logs/sendmail this depend of your enail server software
try this configuration
Go to System > Configuration > ADVANCED > System > Mail Sending Settings
Disable Email Communications = No
Host = I changed it from localhost to mail.mydomain.com
Port (25) = 25
Set Return-Path = No
Good Luck

Related

Ubuntu sendmail only sends to localhost

I have set up a LAMP server with sendmail on Ubuntu 14.04.
When sending mail, either from terminal or PHP mail(), it won't work properly.
When I use mail("user#localhost","test","test"); it sends it correctly, and I can read the message with mail from terminal, but when sending to Gmail address, message won't go trough.
Same outcome when using "test" | mail -s "test" xyz#gmail.com" from server terminal.
Any idea how to fix this?
I have been Googling for several hours now, I have tried everything without finding working solution, and I'm starting to lose hope.
If you're running Ubuntu here is a much simpler solution:
issue from command line >
apt-get install ssmtp
Then edit the configuration file in /etc/ssmtp/ssmtp.conf
A sample configuration to use your gmail for sending e-mails:
# root is the person who gets all mail for userids < 1000
root=your#email.com
# Here is the gmail configuration (or change it to your private smtp server)
mailhub=smtp.gmail.com:587 (leave this the way it is)
AuthUser=your#gmail.com (just change this)
AuthPass=yourGmailPass (and change the password for your gmail account)
UseTLS=YES (leave this the way it is)
UseSTARTTLS=YES (leave this the way it is)
Note: Make sure the "mail" command is present in your system. mailutils package should provide this one in Debian based systems.
Then try send emails again, send it to another domain #gmail, #aol, #yahoo, #privatedomain besides localhost email addresses.
There're tons of possible problems, so you need to get some logs of error that happening.
Most probably, Google just rejects your email as your server is not correctly configured.

Using Test Mail Server Tool with WAMP?

I'm attempting to send some test mail to myself while working on a PHP script. I've researched some other questions and it led me to this tool:
http://www.toolheap.com/test-mail-server-tool/
Others have said that it works perfectly but I'm having trouble using it myself. My php.ini files should be reset to default values as I tried to change the SMTP values at one point, but now they are back to "smtp.wlink.com.np".
For anyone that has used this tool, how does it work? Where do I have to send the e-mail to?
$to = "localhost";
?
Set the php.ini SMTP settings to 127.0.0.1 and port 25.
Send the email to anyone, any address (i.e., send it to obama#whitehouse.gov).
The tool will "intercept" the email, and show it to you. The email will never leave your system.

Mail sent with Symfony2 never delivered

I work with Symfony2, up to date (2.4.1). I send an email with Swifmailer, but it never delivered.
Symfony's logs say the email is sent. I tried with memory and file spooling. With the file spooling when I execute swiftmailer:spool:send --env=dev, it says "Processing default mailer... 1 emails sent". So everything is supposed to work. The config is ok (no delivery_address defined for dev or other way to catch mail while developing).
My SysAdmin says there is no problem on the serverside. The others SF2 host on the same server (other Virtual host) are sending mail fine. So I tried to place my app on a supposed working other virtual host, but no way, emails don't arrived. I begin to think it's an issue with the last version of Symfony (my others app are on 2.4.0). I tried to create a new symfony app, from zero, and I get the same problem. I'm lost. Does somebody have a similar problem? Or a way to fix it?
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
->setFrom('noreply#domain.com')
->setTo('myemail#example.com')
->setBody('TEST');
$this->get('mailer')->send($message);
PS: When I send an email with mail() function of PHP, it works.

How to get PHP to send mail to local users (cakePHP, Linux SLES)

Currently I have a mail server configured (a real one from my ISP) and mail internal and external works on the command line. In PHP only external users work.
For testing I would like to send to internal users only.
( Ideally I would like to set up lots of aliases that point to one user so mail to:
tom#localhost.com, dick#localhost.com, harry#localhost.com end up in /var/mail/johnsmith )
I'd be greatful if someone could help here. I'm hesitant to edit the postfix config files...
On the command line johnsmith#localhost works but not in PHP. It's using cakePHP and I checked the value of $email-addr just before the send ($this->Email->send();) and the value is johnsmith#localhost. I'm not that familiar with cakePHP yet. The var/log/mail shows nothing, only external email addresses.
(server is Suse linux)
You can use the basic mail php function
http://php.net/manual/en/function.mail.php
Under linux, mail php function relies on sendmail, just check that sendmail is properly installed.
In /etc/postfix/main.cf add localhost.com:
mydestination = $myhostname, localhost.$mydomain,localhost,localhost.com
This allows sending on "localuser#localhost.com" via command line. I loaded up a test php mail form script in a browser and it works, sending mail through to /var/mail/localuser.
At the moment it means I have to check each local users /var/mail file. I'm working on the alias. My first attempt at that failed.

PHP mail() failing to send to internal addresses

I am trying to send out password reset links for when users forget their password to login to a system I am creating. The problem is, the smtp server is supposedly not configured on the server my system is hosted on. So whenever I try to use the php mail() function to send an email to an internal email address, the emails fail to send, but outside email address (tested with a gmail account), the emails go through. I believe this is because my server is sending directly out to the internet instead of passing through an internal smtp server to resolve where our domain emails should be sent. I was wondering if anyone knew how to configure this on an Xserve or if they knew how to specifically tell the php mail() function where to initially send the email. Any help or pointing in the right direction would be extremely helpful.
Thank you!
mail() doesn't send mail, it just hands things over to the local SMTP server. It does NOT reach out to the recipient's server to deliver the mail. In real world terms, mail() walks your letter down the street and drops it into the neighborhood mailbox. After that, it has absolutely nothing more to do with mail delivery.
Check your local SMTP server's logs to see why the local mails aren't being delivered. There should be a line or two saying why it's registered. Perhaps the local MTA (mail-transfer agent, aka the local "mail man") isn't configured properly.
You can control mail() with it's settings.
This might not solve your overall problem, but hopefully it's useful. This related answer has more information.
We just addressed this problem internally here. Hopefully this will help you as well.
Our environment:
Ubuntu 12.04 LTS
PHP 5.3.10
We could telnet into our SMTP server and send mail from our web server, so it wasn't a permissions issue. When attempting to mail externally, all works perfectly. When attempting to mail internally, silent failure.
Our PHP is using sendmail, which by default, attempts to relay mail to 127.0.0.1. Point this at your SMTP server by editing /etc/mail/sendmail.cf. Update the line from:
# "Smart" relay host (may be null)
DS
to
# "Smart" relay host (may be null)
DSyour.smtp.server.com
Restart sendmail and try sending yourself an email via PHP.
This is something that occurs on Parellels’ PLESK server administration software.
Find your ‘main.cf’ configuration file for PostFix, which for CentOS 6, is located at
/etc/postfix/main.cf
If you can’t find it, do a
which postfix
SSH command to at least see where Postfix is on your server.
Then, open the file up through a text editor, or in the Linux shell, and make these lines (should be at the end of the file, around line 677) :
virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual
virtual_mailbox_maps = hash:/var/spool/postfix/plesk/vmailbox
commented out like this :
#virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
#virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual
#virtual_mailbox_maps = hash:/var/spool/postfix/plesk/vmailbox
Then, restart the Postfix service
sudo service postfix restart
Apache while your at it (can’t hurt), and voila! Your email address should be receiving those emails now. This also doesn’t affect any of your regular emails or anything else, either.

Categories