Announcement

Collapse
No announcement yet.

Using a Variable in <mvSMPT> Reply-To

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Using a Variable in <mvSMPT> Reply-To

    Hello,

    I am trying to include a reply-to address in emails that get sent out from my non-merchant application. I have been successful when I hard code an email address such as:

    REPLY-TO: "[email protected]"

    But, when I try it with a local variable:

    REPLY-TO: "{ l.email_reply }"

    The Reply-To comes through literally as:

    { l.email_reply }

    I am sure this is just due to my lack of knowledge and that there is a simple solution that hopefully someone can help me with.

    Below are some code snip-its to show what I am trying to do.

    ....Removed unnecessary code for this example

    &lt;MvASSIGN NAME="l.email_reply" VALUE="[email protected]"&gt;

    ....Removed unnecessary code for this example


    &lt;MvSMTP
    MAILHOST = "localhost"
    TO = "{ l.email_to }"
    CC = "{l.email_cc}"
    FROM = "{ l.email_from }"
    SUBJECT = "{ l.email_subject }"&gt;
    REPLY-TO: "{ l.email_reply }"

    &lt;MvEVAL EXPR="{ l.BodyText }"&gt;
    &lt;/MvSMTP&gt;


    Thanks in advance for your help!

    Robin McDermott
    ---------------------------------
    Robin McDermott, CQE
    Director of Training
    QualityTrainingPortal.com

    #2
    I'd try supplying the noheaders value to the FLAGS attribute, and then defining all of the header values yourself, as I suspect the FROM could be overriding the reply-to you're trying to set.

    So try using FLAGS (to set noheaders), MAILHOST, CC, FROM and TO, but not SUBJECT (since you'll be required to supply that later), then the rest in header/body area. Your code would look something like this:

    Code:
    <MvSMTP
     FLAGS = "noheaders"
     MAILHOST = "localhost"
     TO = "{ l.email_to }"
     CC = "{l.email_cc}"
     FROM = "{ l.email_from }">
    Subject: { l.email_subject }
    Reply-To: <{ l.email_reply }>
    From: "Display Name If Applicable" <{ l.email_from }>
    To: <{ l.email_to }>
    
    <MvEVAL EXPR="{ l.BodyText }">
    </MvSMTP>
    Last edited by ILoveHostasaurus; 04-20-16, 08:04 AM.
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment


      #3
      Hi, thanks for the thoughts. Unfortunately, that didn't do the trick. Here is the header when I used that code (I replaced real info with xxx in domain names):

      Code:
      X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on xxx.us
      X-Spam-Level: *
      X-Spam-Status: No, score=1.1 required=7.0 tests=ALL_TRUSTED,BAYES_00,
          MISSING_DATE,MISSING_MID,TO_MALFORMED,URIBL_BLOCKED autolearn=no version=3.3.1
      Received: (qmail 34257 invoked by uid 30); 20 Apr 2016 13:36:30 -0400
      Delivered-To: [email protected]
      Received: (qmail 34249 invoked by uid 30); 20 Apr 2016 13:36:30 -0400
      Delivered-To: [email protected]
      Received: (qmail 34240 invoked from network); 20 Apr 2016 13:36:30 -0400
      Received: from unknown (HELO rehostserver.us) (0000:0000:0000:0000:0000:0000:0000:0001)
        by 0000:0000:0000:0000:0000:0000:0000:0001 with ESMTPA; 20 Apr 2016 13:36:30 -0400
      Subject: { l.email_subject }
      Reply-To: <{ l.email_reply }>
      From: "Display Name If Applicable" <{ l.email_from }>
      To: <{ l.email_to }>
      X-Brightmail-Tracker: AAAAASW2/CA=
      X-Brightmail-Tracker: AAAAAA==
      All of the variables have been defined above this code.
      ---------------------------------
      Robin McDermott, CQE
      Director of Training
      QualityTrainingPortal.com

      Comment


        #4
        Sorry, I don't actually know MivaScript, so I left off the mveval. Try:

        Code:
        <MvSMTP
         FLAGS = "noheaders"
         MAILHOST = "localhost"
         TO = "{ l.email_to }"
         CC = "{ l.email_cc }"
         FROM = "{ l.email_from }">
        Subject: <MvEVAL EXPR="{ l.email_subject }">
        Reply-To: <MvEVAL EXPR="{ '<' $ l.email_reply $ '>' }">
        From: "Display Name If Applicable" <MvEVAL EXPR="{ '<' $ l.email_from $ '>' }">
        To: <MvEVAL EXPR="{ '<' $ l.email_to $ '>' }">
        
        <MvEVAL EXPR="{ l.BodyText }">
        </MvSMTP>
        And of course replace or remove the display name as appropriate; I just threw that in there so you'd know how to have a "From" with both a display name and email.
        Last edited by ILoveHostasaurus; 04-20-16, 10:09 AM.
        David Hubbard
        CIO
        Miva
        [email protected]
        http://www.miva.com

        Comment


          #5
          Wow! awesome. It worked. I would say you do KNOW mivascript!

          Thank you.

          Robin
          ---------------------------------
          Robin McDermott, CQE
          Director of Training
          QualityTrainingPortal.com

          Comment

          Working...
          X