Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
I am sending emails using the phpMailer in couch. However the emails I receive show that the email is Root User istead of showing a name instead. Any leads why it is so and how to change that?
Screenshot 2019-03-05 at 8.16.13 AM.png
Screenshot 2019-03-05 at 8.16.13 AM.png (123 KiB) Viewed 87 times
Difficult to say without seeing exactly how you are sending the emails.
Please post the part of your code that does that.
OK KK Thanks. The following is how I am sending the email:
On form success:
Code: Select all
<cms:if k_success >
    <cms:set email_from='Nano Wines and Cards' />   
    <cms:set email_bcc='adimpressions@live.com' />   
    <cms:set email_subject='Order on Nano Website' />
    <cms:set email_debug='0' />
    <cms:set order_date="<cms:date format='%b %d, %Y %H:%M:%S' locale='english'/>" />

    <cms:set random_numbers="
       <cms:php>
          function random_str($type = 'alphanum', $length = 8)
  {
      switch($type)
      {
          case 'basic'    : return mt_rand();
              break;
          case 'alpha'    :
          case 'alphanum' :
          case 'num'      :
          case 'nozero'   :
                  $seedings             = array();
                  $seedings['alpha']    = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
                  $seedings['alphanum'] = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
                  $seedings['num']      = '0123456789';
                  $seedings['nozero']   = '123456789';

                  $pool = $seedings[$type];

                  $str = '';
                  for ($i=0; $i < $length; $i++)
                  {
                      $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
                  }
                  return $str;
              break;
          case 'unique'   :
          case 'md5'      :
                      return md5(uniqid(mt_rand()));
              break;
      }
  }

echo random_str('alphanum', 5);
       </cms:php>

    " />

    <cms:set invoice_id="<cms:concat <cms:show frm_name /> random_numbers />" />
                   
    <cms:embed 'sales_email.html' />   

    <cms:set_flash name='order_complete_msg' value="<cms:embed 'sales_success_msg.html' />"/>
                   
    <cms:pp_empty_cart />
    <cms:redirect k_page_link />
</cms:if>


This is the send_email.html file
Code: Select all
<cms:send_mail html='1' from=email_from to=frm_email bcc=email_bcc subject=email_subject debug=email_debug>
  Thank you for your order, <cms:show frm_name /> <cms:show frm_last_name />.
        Your order has been confirmed and is being processed.
</cms:send_mail>
It would appear, prima facie, that the following statement is not correct -
Code: Select all
<cms:set email_from='Nano Wines and Cards' />

It needs to be set as a valid email address. Please try doing that.
Hi KK,
Thank you very much for pointing me to the right direction. It worked. However is there no way I can use a name instead of the email address?
I searched through the forum and found this which worked:
Code: Select all
from="Nano Wines and Cards <nanowines@gmail.com>"


But I want to know if doing this will work, so that I can be able to grab the email from the input field dynamically.
Code: Select all
from="Nano Wines and Cards <<cms:show email_from />>"
6 posts Page 1 of 1

Who is online

In total there are 7 users online :: 0 registered, 0 hidden and 7 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 7 guests