Hi,

I have a input button like this :

<li class="b-tn"><div class="apply_btn"><form action="#"><input type="submit" value="sbmit"></form></div></li> 

And i have attachment url in : $attachment_url

I want to sent mail to for exemple "example@example.com" with this attachment once I click on the button sumbit.

Thank you

Comments

Stefan Lehmann’s picture

Combine following links:
https://api.jquery.com/click/
http://api.jquery.com/jquery.ajax/
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
https://api.drupal.org/api/drupal/includes!mail.inc/function/drupal_mail/7

There are several examples of how to send attachments via drupal_mail (Google). Also be aware, that a mail function triggered by AJAX is a very handy way to abuse your website. Triple secure this functionality.

I like cookies!