Alpha Video Training
Results 1 to 9 of 9

Thread: Email Reply-To header - How to set it?

  1. #1
    "Certified" Alphaholic mikeallenbrown's Avatar
    Real Name
    Mike Brown
    Join Date
    Nov 2009
    Location
    United States
    Posts
    1,865

    Default Email Reply-To header - How to set it?

    Web app on 5667.

    An app I'm working on sends emails via a Notification@myApp.com address. I need to be able to set the reply-to header in these emails so that when the user reply's to them they don't come back to Notification@myApp.com but are sent to the address in the reply-to header.

    I'm currently using email_send_noprofile() to handle my emails. How can I set it here? If I can't I'm open to other suggestions.

    Alpha's documentation on the method I'm using:Click me.

    Thanks in advance.


    For those interested in this issue here's a stack overflow post on the subject: Click me.
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

  2. #2
    "Certified" Alphaholic
    Real Name
    Larry Grupido
    Join Date
    May 2010
    Posts
    1,813

    Default Re: Email Reply-To header - How to set it?

    I think you can just set the header to:

    Reply-To: myemail@myemail.com

    But I have never done it this way myself. (I always use a profile or I use Mandrill/Sparkpost)

  3. #3
    "Certified" Alphaholic mikeallenbrown's Avatar
    Real Name
    Mike Brown
    Join Date
    Nov 2009
    Location
    United States
    Posts
    1,865

    Default Re: Email Reply-To header - How to set it?

    Great...but what I'm asking is how? In Alpha's documentation of this method I don't see this parameter.

    Sample email_send_noprofile() code...
    Code:
            dim p as p
    	dim p.hasError as l = .f.
    	dim p.errorText as c = ""
    	dim rs as p
    	dim pSmtpSettings as p
    	dim pMesssageSettings as p
    	dim secureMode as c = "TLS"
    	dim whatMessage as c = ""
    	
    	'e-mail account details
    	dim sender as c = "Notifications@myApp.com"
    	dim senderName as c = "My App Notifications"
    	dim password as c = "1234ABCD"
    		
    	'receiver detail
    	dim send_to as c = recipient
    
    	whatMessage = message
    
            'create sender server parms
    	pSmtpSettings.smtp_server = "smtp-mail.outlook.com"
    	pSmtpSettings.smtp_username = sender
    	pSmtpSettings.smtp_password = password
    	pSmtpSettings.smtp_port = 587
    	
    	'create the message detail
    	pMesssageSettings.message = whatMessage
    	pMesssageSettings.html_message = whatMessage
    	pMesssageSettings.send_to = send_to
    	pMesssageSettings.subject = subject
    	pMesssageSettings.attachments = ""
    	pMesssageSettings.cc = ""
    	pMesssageSettings.bcc = ""
    	pMesssageSettings.lRelated = .f.
    	pMesssageSettings.ReturnReceipt = .f.
    	pMesssageSettings.from = sender
    	pMesssageSettings.from_alias = senderName
    	
    	'Send user eMail		
    	rs = email_send_noprofile(pSmtpSettings,pMesssageSettings,secureMode)
    
            if rs.error = .f.
    		'email sent successfully	
    		exit function
    	else 	
    		'email failed
    		p.hasError = .t.
    		LogIt("Failed to send email. Subject: " + subject + "   Recipient: " + recipient)
    		exit function
    	end if
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

  4. #4
    "Certified" Alphaholic
    Real Name
    Larry Grupido
    Join Date
    May 2010
    Posts
    1,813

    Default Re: Email Reply-To header - How to set it?

    It is a part of the header of the email, so ...

    pmMessageSettings.headers = "Reply-To: myemail@myemail.com"

  5. #5
    "Certified" Alphaholic mikeallenbrown's Avatar
    Real Name
    Mike Brown
    Join Date
    Nov 2009
    Location
    United States
    Posts
    1,865

    Default Re: Email Reply-To header - How to set it?

    That didn't seem to have any effect. After receiving a test email I sent (after adding this code line) I replied and it just replied to my notifications email that originally sent it.
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

  6. #6
    "Certified" Alphaholic
    Real Name
    Larry Grupido
    Join Date
    May 2010
    Posts
    1,813

    Default Re: Email Reply-To header - How to set it?

    I am not sure I have the coding exactly right, I just know that the reply to goes in the header based on a quick internet search.

    You might search the web a bit to see how to properly format the reply to in the header in case I got it wrong.

    You could also send an email to yourself with a reply to setup (outside of alpha or from a different profile or whatever) then inspect the header of the email you receive to get the right coding.

  7. #7
    "Certified" Alphaholic
    Real Name
    Larry Grupido
    Join Date
    May 2010
    Posts
    1,813

    Default Re: Email Reply-To header - How to set it?

    Note: If you look at the Alpha Documentation, it says in the header section that it is used for reply-to, but it doesn't have an example, maybe ping the Alpha documentation people to see if they can fix that ...

  8. #8
    "Certified" Alphaholic mikeallenbrown's Avatar
    Real Name
    Mike Brown
    Join Date
    Nov 2009
    Location
    United States
    Posts
    1,865

    Default Re: Email Reply-To header - How to set it?

    Quote Originally Posted by lgrupido View Post
    Note: If you look at the Alpha Documentation, it says in the header section that it is used for reply-to, but it doesn't have an example, maybe ping the Alpha documentation people to see if they can fix that ...
    Thanks Larry. Didn't see that part. I'll reach out to them.
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

  9. #9
    "Certified" Alphaholic mikeallenbrown's Avatar
    Real Name
    Mike Brown
    Join Date
    Nov 2009
    Location
    United States
    Posts
    1,865

    Default Re: Email Reply-To header - How to set it?

    Found the problem (and before I contacted Alpha ...thankfully).

    Was a simple typo. Below is in fact the correct syntax.

    Code:
    pMesssageSettings.headers = "Reply-To: myemail@email.com"
    Thanks again Larry for your help.
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

Similar Threads

  1. Email_Send Reply To
    By lgrupido in forum Mobile & Browser Applications
    Replies: 0
    Last Post: 10-13-2016, 04:04 PM
  2. Updating "reply to" when sending an email using email_send2
    By lgrupido in forum Mobile & Browser Applications
    Replies: 5
    Last Post: 07-17-2015, 12:27 PM
  3. Specify separate reply to email address?
    By TheSmitchell in forum Application Server Version 11 - Web/Browser Applications
    Replies: 5
    Last Post: 02-26-2013, 04:29 PM
  4. Email Header ok but body blank?
    By andycaps in forum Alpha Five Version 8
    Replies: 1
    Last Post: 01-18-2010, 09:02 PM
  5. Reply to in email
    By George Corder in forum Alpha Five Version 5
    Replies: 1
    Last Post: 06-03-2004, 09:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •