1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Contact Form and Amazon Web Services (SES)

Discussion in 'Troubleshooting and Problems' started by robdog, Sep 5, 2013.

  1. robdog

    robdog Well-Known Member

    I use Amazon Web Services to send all email through my forums. With the recent updates, I am getting a verified error when someone fills out the contact form.

    Amazon returns this error when the email address sending the email is not verified. Did something change with the contact form? Is the from fiend, the email address the user enters into the contact form?

    Can we change the from email address to the default email address and set the reply to field to the value entered by the person filling out the contact form?

    Anyone else use AWS for sending email and running into the same problem?
  2. Andy.N

    Andy.N Well-Known Member

    It has been noted before and Mike said there is nothing XF can do about it until AWA SES allow the option to send from a different address.
  3. robdog

    robdog Well-Known Member

    hhmmm... XenForo could allow us to configure a "reply-to" option. So it could be from our configured support email address, but if they reply button is pressed it will send the reply to the email entered into the contact form.

    @Mike is that feasible?

    @Andy.N can you link me to the thread you are referring to?

    And something else to check out:
  4. Andy.N

    Andy.N Well-Known Member

  5. robdog

    robdog Well-Known Member

    They do support it. Here is the developers comments who implemented it:
  6. Mike

    Mike XenForo Developer Staff Member

    He's referring to the Sender header, which is the "correct" way of doing this - it's basically the exact situation it was designed for.
  7. robdog

    robdog Well-Known Member

    Ah, well. Can always extend this functionality to do what I want. :)

    Will update this thread when I can get the reply-to field working properly.
  8. Noobstradamus

    Noobstradamus Member

    Did you ever get this figured out for Amazon SES robdog?
  9. hqarrse

    hqarrse Active Member

    I have mine working with a nasty code hack - I had the same problem with VBulletin and have just done the same quick fix. SES will not accept the Sender header for me, and only allows email through if it is form my domain. (this is possibly related to my setup as I use postfix as local relay to run a queue on the server that allows me to better handle the delays in sending batch email across the Atlantic, rather than trying to connect to SES directly from XF/PHP via SMTP).

    The hack is to change line 394 of library/XenForo/ControllerPublic/Misc.php and change what gets sent to the mail() method of XF's mail class. As below (original line commented out, replacement below)

     /* $mail->send(
                                    XenForo_Application::get('options')->contactEmailAddress, '', array(
                                            'Sender' => XenForo_Application::get('options')->contactEmailAddress
                                    $user['email'], $user['username']
    XenForo_Application::get('options')->contactEmailAddress'', array(
    'Reply-To' => $user['email']
    The change sets the 'from' as your site admin address, which gets it through SES, then the 'Reply-To' header means that when you answer it goes to the right place.

    I'm very new to XF and am just getting ready for my first import from VB. I'm also not a PHP developer so I am not about to try and make the above a more correct modification - I assume method overrides are catered for? I would be grateful if someone else would though, so that when I upgrade I don't have to bodge it again!
    Trained Monkey and thedude like this.
  10. thedude

    thedude Well-Known Member

    Just a heads up, the line is 194, not 394. The reply-to method works well
  11. robdog

    robdog Well-Known Member

    Yeah I finally got this working as a plugin. Pretty easy once I sat down to actually do it. I just needed to stop being so lazy! :p
  12. TheBigK

    TheBigK Well-Known Member

    Maybe you should release the add-on. :)
    trizz likes this.
  13. thedude

    thedude Well-Known Member

  14. robdog

    robdog Well-Known Member

    Nice, this is exactly what I was asking for, lol.

    Looking forward to 1.4 now.

Share This Page