Ideanode Easy Mailer

# Posted Oct 8, 9:53pm

If you need to send mail from your web site to one of your email accounts, but don't want to go through the hassle of setting up some code to do it (or you'd just like a quick form to post to from Flash), it's easy. Just post your form to:

http://www.ideanode.com/mailer/send

The mailer understands the following form variables:

sender_nameThe name of the person sending the mail (like "Bob Smith")
from_emailThe email address of the person sending the email.
to_emailThe email address of the recipient of the email -- note that this address needs to be configured as either an email account or forward in Control or it won't work.
subjectThe subject of the email
bodyThe body of the email
success_urlWhere to send the user if the mail gets sent successfully. (this should be a full url starting with http://)
failure_urlWhere to send the user if the mail doesn't get sent. (this should be a full url starting with http://)
debugIf set to "true" This won't send a message, but rather just show you the results of your attempt. Useful for seeing why something isn't working.

Note that you will need to send the mail to an email address hosted at Ideanode, another address (like Hotmail) won't work. If you do want to send to an external address, just login to Control and create a new Email Forward (Settings → Email Forwards) from an account at your domain to the desired email address.

An example in HTML is below:

<html>
<head>
<title>Send Mail</title>
</head>
<body>

<h1>Send me an Email</h1>

<form action="http://www.ideanode.com/mailer/send" method="post" name="mail" id="mail">

<p>Your Email:<br/>
<input name="from_email" type="text" id="from_email" size="20">
</p>
<p>Subject:<br>
<input name="subject" type="text" id="subject" size="20">
</p>

<p>Your Message:<br>
<textarea name="body" cols="20" rows="3"></textarea>
</p>

<input type="hidden" name="to_email" value="me@example.com" />
<input type="hidden" name="success_url" value="http://www.example.com/thanks.html" />
<input type="hidden" name="failure_url" value="http://www.example.com/sorry.html" />

<p><input name="Send Email" type="submit" id="Send Email" value="Send Email"></p>

</form>
</body>
</html>

If you're more into Flash, check out how Flash forms work at this article on DevShed.

Custom Fields

If you want to have some custom fields in your mail, like, say, a phone number, and have that listed in the body as a seperate item, just put the name of it in the fields[] bracket as the name for your form element.

For a phone number, for example, you'd put the code in like this:

<input name="fields[phone_number]" type="text">

For a full example form with a phone number and Zip code, you'd do it like this:

<html>
<head>
<title>Send Mail</title>
</head>
<body>

<h1>Send me an Email</h1>

<form action="http://www.ideanode.com/mailer/send" method="post" name="mail" id="mail">

<p>From Email:<br/>
<input name="from_email" type="text" id="from_email" size="20">
</p>

<p>To Email:<br/>
<input name="to_email" type="text" id="to_email" size="20">
</p>

<p>Subject:<br>
<input name="subject" type="text" id="subject" size="20">
</p>

<p>Your Message:<br>
<textarea name="body" cols="20" rows="3"></textarea>
</p>

<p>Phone Number:<br>
<input name="fields[phone_number]" type="text">
</p>

<p>Zip Code:<br>
<input name="fields[zip_code]" type="text">
</p>
	
<input type="hidden" name="success_url" value="http://www.example.com/thanks.html" />
<input type="hidden" name="failure_url" value="http://www.example.com/sorry.html" />

<p><input name="Send Email" type="submit" id="Send Email" value="Send Email"></p>

</form>
</body>
</html>

Join the Mailing List

We will never sell or distribute your email address — just occasional news about what we're up to.

Name Email