amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

How can i send email from my AMP contact form.I want to send mail to my personal email.

Open binarycubeit opened this issue 9 years ago • 6 comments

I have created a page and i need to add a contact form for it.Problem is My contact form is not working.Or i am not able to make it works.what will be the method and what will be the action.Nothing is clear to me.

here is my code but it shows error.Action is not work for post method.

      <form method="post" action="Mail_Sender/index.php">
      <input type="text" name="email" placeholder="Email..." class="contact-email">
      <input type="text" name="subject" placeholder="Subject..." class="contact-subject">
      <textarea name="message" placeholder="Message..." class="contact-message"></textarea>
      <button type="submit">Send message</button>
    </form>

Please help me about it.

binarycubeit avatar Feb 17 '17 16:02 binarycubeit

There is reference to this in the docs here: https://www.ampproject.org/docs/reference/components/amp-form

"action (optional for GET, invalid for POST)"

bjalford avatar Feb 17 '17 16:02 bjalford

Hello bjalford,

I have studied this documents last couple of days.i did not understand how i will make it work.what i need help from someone who can make tell me which form action i will use and the action file i have he will check it for me to fixes the issues.

Can you help me?

binarycubeit avatar Feb 17 '17 17:02 binarycubeit

@binarycubeit Please set action-xhr instead of action. Please also note that your endpoint (Mail_Sender/index.php) needs to implement AMP CORS requirements for security reasons.

aghassemi avatar Feb 17 '17 18:02 aghassemi

Hello aghassemi ,

For use action-xhr my domin need to be ssl certified.I mean https:// but it is not https it is just http.you have any ready made code so i can use it.

Thanks

binarycubeit avatar Feb 17 '17 19:02 binarycubeit

That's part of AMPs security requirements. Endpoints must be https.

aghassemi avatar Feb 17 '17 19:02 aghassemi

@binarycubeit Closing this issue, please feel free to re-open if there is anything else we can help with.

aghassemi avatar Feb 22 '17 01:02 aghassemi