How can i send email from my AMP contact form.I want to send mail to my personal email.
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.
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)"
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 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.
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
That's part of AMPs security requirements. Endpoints must be https.
@binarycubeit Closing this issue, please feel free to re-open if there is anything else we can help with.