logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$50
WooCommerce/Comment Notification Change Email and From name

When WooCommerce sends an order verification email it shows our company email and from name (which is not the website that it was setup on). The same goes to when WP sends out emails for comment notifications.

Example:

The website is ABC Company <info@abc.com> and it sends it saying that it's from XYZ Company <info@xyz.com>

I need to know how to have the website send from website ABC Company <info@abc.com>

I was told it had to do with the server and that WordPress sends out emails with the servers email credentials.

I have 20 websites that are all different and need to know how to resolve this for each website.

Thanks.

This question has been answered.

Adam | 08/02/12 at 6:19pm Edit


(11) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    08/02/12
    6:24pm
    AdamGold says:

    Couple of ideas:
    1. Settings -> General -> Admin URL
    2. Users -> Edit the admin -> change email
    3. Manually change admin_email in wp_options table in the database

  • avatar
    Last edited:
    08/02/12
    6:25pm
    Martin Pham says:

    try this plugin
    http://wordpress.org/extend/plugins/wp-mail-smtp/

    • 08/02/12 6:28pm

      Adam says:

      I have tried it and it didn't seem to work....I don't know why.

    • 08/02/12 6:49pm

      Martin Pham says:

      you can just config field:
      - From Email
      - From Name
      And select "Send all WordPress emails via SMTP"

      --- OR ---

      Contact supports of your server provider to configure the SMTP information.

    • 08/02/12 7:10pm

      Adam says:

      The problem is that I don't want all emails sent to have the same info (email and from name) for all the sites.

  • avatar
    Last edited:
    08/02/12
    6:30pm
    Fahd Murtaza says:

    You can add it in functions.php for each site's theme and modify the emails as per your need


    add_filter ("wp_mail_content_type", "my_awesome_mail_content_type");
    function my_awesome_mail_content_type() {
    return "text/html";
    }

    add_filter ("wp_mail_from", "my_awesome_mail_from");
    function my_awesome_mail_from() {
    return "hithere@myawesomesite.com";
    }

    add_filter ("wp_mail_from_name", "my_awesome_mail_from_name");
    function my_awesome_email_from_name() {
    return "MyAwesomeSite";
    }


    Here is the interesting article I pulled this info from

    http://wp.smashingmagazine.com/2011/10/25/create-perfect-emails-wordpress-website/

    Previous versions of this answer: 08/02/12 at 6:30pm

    • 08/02/12 6:57pm

      Adam says:

      It seems there is more to it than just adding that to the functions.php file (from what the article pointed out)...any chance you want to try to get this working for me?

  • avatar
    Last edited:
    08/02/12
    6:30pm
    Asad Iqbal says:

    What is primary email address currently and what do you expect (from which mail)?

    • 08/02/12 6:57pm

      Asad Iqbal says:

      Can you please check the default email address (Settings -> General) and WooCommerce "New order notifications" mail address (WooCommerce -> Emails). Kindly let me know if they are same or not.

    • 08/02/12 7:04pm

      Adam says:

      These are set to the correct place...I emailed WooThemes and they said that what was happening is not supported by their plugin/theme. So it's definitely server related.

      I need an easy to implement solution across all my WP sites.

    • 08/02/12 7:09pm

      Asad Iqbal says:

      Same thing happen to your other 20 websites? Or these website which are hosted in same sever?

    • 08/02/12 7:10pm

      Adam says:

      I will apply the solution to all the sites....they're on the same server.

    • 08/02/12 7:21pm

      Asad Iqbal says:

      Did you use any installer to install the wordpress to your host? Or install wordpress manually? And I asked that do all the sites of same server causing same problems?

    • 08/02/12 7:23pm

      Adam says:

      We use Softaculous to install the WP sites on the server...yes all.

    • 08/02/12 7:32pm

      Asad Iqbal says:

      Okay, autoinstaller may cause problems. Do one thing for test. Go to 'wp-includes' directory and open 'class-phpmailer.php' and then go to line number 81

      public $From = 'root@localhost';

      change it to

      public $From = 'your@mail.address';

      Then test and let me know.

      And also don's forget to check that you told

      "The website is ABC Company <info@abc.com> and it sends it saying that it's from XYZ Company <info@xyz.com>"

      So, please check your cPanel admin email address is 'info@xyz.com' or not.

    • 08/02/12 7:46pm

      Adam says:

      Nope...didn't work. thx

    • 08/03/12 4:25am

      Asad Iqbal says:

      Is there any chance that you forward all emails to one address from cPanel? Can you please check?

  • avatar
    Last edited:
    08/02/12
    6:43pm
    Sean Grant says:

    Adam,

    I think Martin Pham has the right idea. If that plugin didn't work for you try this one:
    http://wordpress.org/extend/plugins/configure-smtp/

    I use it on my website iamseangrant.com and it is configured to send via Gmail SMTP with a secure connection. This is because I use Google Apps/Gmail to manage my email for the domain. Thus bypassing all server related mail.

    I've used it on a couple other domains as well, all using Gmail as SMTP server.

    Hope this helps!

    Peace,
    Sean Grant

    • 08/02/12 6:50pm

      Adam says:

      I just tried it, it didn't work....here's a screen shot. I can only upload one image with here so I'll upload the other with the email that I received.

      Attached Image

    • 08/02/12 6:51pm

      Adam says:

      Here's the other screen shot...

      Attached Image

    • 08/02/12 6:56pm

      Adam says:

      Here's another screenshot of the results that WP-Mail SMTP had showing after sending out a test email.

      Attached Image

  • avatar
    Last edited:
    08/02/12
    7:25pm
    Daniel Yoen says:

    try this plugin : http://wordpress.org/extend/plugins/mail-from/

    hope this help

    • 08/02/12 7:26pm

      Adam says:

      Tried it, never worked. Thanks.

    • 08/02/12 7:29pm

      Daniel Yoen says:

      or try to paste this line to functions.php

      add_filter('wp_mail_from', 'new_mail_from');
      add_filter('wp_mail_from_name', 'new_mail_from_name');

      function new_mail_from($old) {
      return 'admin@yourdomain.com';
      }
      function new_mail_from_name($old) {
      return 'Your Blog Name';
      }

    • 08/02/12 7:47pm

      Adam says:

      That didn't work....have you tested this?

    • 08/02/12 8:24pm

      Daniel Yoen says:

      Opps, sorry..

      yes, I use on my blog, or try to check your php.ini, find this line :

      sendmail_path = /usr/sbin/sendmail -t -i -f'email@domain.com'


      replace with :

      sendmail_path = /usr/sbin/sendmail -t -i


      What web hosting provider do you use? :)

      Daniel

    • 08/02/12 8:30pm

      Adam says:

      I can't seem to find that file....we're with softlayer

    • 08/02/12 9:06pm

      Daniel Yoen says:

      Sorry I'm not familiar with softlayer, you may need to contact their customer service :)

      try again with this code :

      function shifnet_mail_name($email)
      {
      return 'Your Blog Name';
      }
      function shifnet_mail_from($email)
      {
      return 'mail@domain.com';
      }
      add_filter('wp_mail_from_name', 'shifnet_mail_name');
      add_filter("wp_mail_from", "shifnet_mail_from");


      tested in my blog, this is screenshot in my view

      good luck :)

      don't forget to add email account in cpanel :)

      Attached Image

  • avatar
    Last edited:
    08/02/12
    11:05pm
    Arnav Joy says:

    try this plugin

    http://wordpress.org/extend/plugins/wp-better-emails/

    or

    http://wordpress.org/extend/plugins/mail-from/

  • avatar
    Last edited:
    08/03/12
    12:30am
    Clifford P says:

    Hi. I didn't read everyone's specific comments, but the code on this blog post of mine might be exactly what you're looking for: http://wpmu.org/wordpress-email-settings/

    If it doesn't work, then it's because your plugin is using its own email send settings. If that's the case, you may private message me a SFTP login and wp-admin login.

  • avatar
    Last edited:
    08/03/12
    1:01am

    This answer was downvoted by the top experts.

  • avatar
    Last edited:
    08/03/12
    4:01am
    Gabriel Reguly says:

    Hi,

    Seems you want to change WooCommerce emails, not WordPress emails.

    Try changing it at

    http://abc.com/wp-admin/admin.php?page=woocommerce&tab=email

    Regards,
    Gabriel

    • 08/03/12 4:09am

      Gabriel Reguly says:

      Please check attached image.

      Attached Image

    • 08/03/12 4:15am

      Adam says:

      Thanks, but it doesn't work. I asked WooThemes company and they said it's nothing do to with their products.

    • 08/03/12 4:19am

      Gabriel Reguly says:

      Hmm, so the issue is at your server?

      Would you send me a PM with cPanel login details?

      Regards,
      Gabriel

  • avatar
    Last edited:
    08/03/12
    5:50am
    Francisco Javier Carazo Gil says:

    Hi,

    As you can see in Woocommerce source code, from mail and from address are defined in the class that defines email interaction:


    $this->_from_name = get_option('woocommerce_email_from_name');
    $this->_from_address = get_option('woocommerce_email_from_address');


    So in your table "wp_options" of your blog you have to go directly and update those two options: woocommerce_email_from_name and woocommerce_email_from_address.

    • 08/03/12 5:52am

      Francisco Javier Carazo Gil says:

      To update those options directly without using SQL code you can add to your functions.php in your theme these lines:


      update_option( "woocommerce_email_from_name", "ABC Company" );
      update_option( "woocommerce_email_from_address", "info@abc.com" );


      If you need further help, please tell me and I will do it directy in your host.

    • 08/03/12 5:53am

      Francisco Javier Carazo Gil says:

      WooCommerce hasn't a good documentation but I have been doing fix for this for a year more or less and I know how it works.

    • 08/03/12 6:39am

      Adam says:

      Doesn't look like that's true...it displays the information I need to have sent as the from email and name but it's not being displayed correctly when emailed.

      Attached Image

    • 08/03/12 6:40am

      Adam says:

      second image...

      Attached Image

    • 08/03/12 6:41am

      Adam says:

      third image showing what it's displaying when emailed...

      Attached Image

    • 08/03/12 6:43am

      Francisco Javier Carazo Gil says:

      Are you using a WordPress network?

      Disable SMTP you are using and use this one: http://wordpress.org/extend/plugins/hgk-smtp/

      Introduce in this plugin config, in WP settings and in WooCommerce settings (you have done it) the info you need.

This question has expired.



Gabriel Reguly, Adam voted on this question.



Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.