Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

binaural42

macrumors newbie
Original poster
Aug 23, 2010
5
0
Hello, I designed a webpage using iWeb and cannot for the life of me figure out how to implement email. What I want is for visitors to be able to send email directly from the site to me. I downloaded iTweak but I can't get it to work with my site since I upload it through ftp and not MobileMe. I've done many searches concerning this and found many links that lead me nowhere. Anybody got a simple solution?

Thanks!

Here's the site: www.espantapajarosmusic.com
 
No. I don't want a button that launches the Mail application. I want users to be able to type the email right in the page and send it, similar to a guestbook form so they can type their email address, a subject and the message within a form.
 
You'll need to use a form that goes through a 3rd party site because MobileMe has no server side processing that is required for this.
 
You said you upload through FTP not MobileMe, do you know if the server that serves your page supports PHP or other server-side scripting?
 
I understand I'll have to set up the form with some other site and use the HTML code to put it in my site I just can't find one that works for me.

etchtech, I don't know but I just emailed the host tech support and asked them.
 
and this is what they replied:

"PHP is no problem, but what other services were you looking to have?"

Thanks for your help.
 
This is a sample page...

<?php
if (isset($_POST['submit'])) { //Handle the form
// To email
$to = "email@domain.com"; //Where to send email
$subject = "Comments From Site"; //The subject
$headers = "-f" . $_POST['sender']; //Their address
$msg = $_POST['message']; //The actual message
mail ($to, $subject, $msg, null, $headers); //The mail function
$view_msg = "Mail Sent";
} else {
$view_msg = "
<BODY>
<FORM action='" . $_SERVER['PHP_SELF'] . "' method=post name='email'>
From: <INPUT type=text name='sender'>
<BR />
Message: <INPUT type=textarea name='message'>
<BR />
<INPUT type=submit name=submit value='Submit' />
</FORM><!-- End of Form -->";
}

echo $view_msg;
?>
 
The above code would work with a little modification for your site. I would recommend doing some sort of validation on the form, but otherwise it should work for you.

Remember, for php, php.net is your best friend.
 
echtech, I can't get that code to work... I don't know squat about HTML (that's why I'm using iWeb) I'm sure I'm supposed to modify certain things but have no clue what.

Alphakline: Thanks! That looks light it may work, my only problem right now is that the form looks fine on iweb but on the actual browser you can't see the Submit button very well and when I send myself a test email, I get a message with a bunch of code, I can't read anything...
 
For the code to work, it needs to be on a server that supports php and in a file with the extension .php.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.