aMail Generate and send email from a simple form

Price

This awesome project was born when my friend and colleague Fred Audet generously shared his BIG IDEA with me and tried to have me work on it. Thing is, I was already drowning in an overabundance of jobs and had no time for my pal. But on a hot and relentless evening, I decided to take the bull by the horns and use my precious hours to finally do it and create a very cool library that Fred and all of you guys can use.

The idea is to use PHP to send auto generated emails. The library needs to be cross-browser and fully compatible with any simple form code.

Only 5k and supporting multi-lang (english, français, and you can add your own). Work well with input, radio, checkbox and hidden field!

Demo form

*

*

*


Form Code

<form action="amail.php" method="post"  id="form-demo">
    <p>
        <label for="name">Full Name</label><br />
        <input type="text" name="name" id="name" value="" />
    </p>
    <p>
        <label for="email">Email</label><br />
        <input type="text" name="email" id="email" value="your.name@domain.com" />
    </p>
    <p>
        <label for="website">Website Url</label><br />
        <input type="text" name="website" id="website" value="http://" />
    </p>
    <p>
        <label for="comment">Comments and/or Suggestions</label><br />
        <textarea name="comment" id="comment"></textarea>
    </p>

    <button type="submit" name="submit">Send</button>
</form>
<script type="text/javascript" src="amail.js"></script>
<script type="text/javascript">amail.add('form-demo');</script>
	

Sample of the auto-generated email

Full Name
Philippe Archambault
Email
your.name@domain.com
Website Url
http://www.philworks.com
Comments and/or Suggestions
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed egestas quam id justo tincidunt et pretium velit dictum. Vivamus euismod laoreet dui, ac laoreet massa tristique quis. Ut luctus imperdiet suscipit. Donec eu est id lectus posuere tempus. Duis et lacus tellus, blandit imperdiet sapien. Nullam eget nibh sed erat laoreet condimentum. Donec hendrerit aliquam nulla, et blandit sapien mattis a. Quisque facilisis odio at ipsum vestibulum porta. Cras eu massa diam, eu consequat ante. Nullam a condimentum nibh. Maecenas dui mi, sodales at interdum nec, dignissim ut arcu. Aliquam nec neque eros, sed gravida mauris.

www.philworks.com

test

Email templates

available tags

 in 'header':
     {subject} = the subject of the email
 in 'footer':
     nothing (for the moment)
 in 'each':
     {key}     = label or name of the field
     {value}   = content from the user

Hacks

If you want the form to be replaced with the confirmation message, add a div over the form with the id: amail-msg