Web Hosting News, Web Hosting Tips, Web Hosting Tutorials and FAQ by AwardSpace.com
AwardSpace Blog » Posts in 'FAQ' category

Example contact form (form-to-mail). 5 comments

Our servers require SMTP authentication, which in plain English means you will have to use any of your e-mail accounts, created within the E-mail Manager -> E-mail Accounts section from your control panel.
You can see the code of an example contact form below(contact.html):

<html>
<head>
<title>
Contact form
</title>
</head>
<body>
<center>
<font size=”5″>
<b>
Contact form
</b>
<br>
<br>
</font>
<form method=”POST” action=”mailer.php”>
Subject:
<input type=”text” name=”subject” size=”20″>
<br>
<br>
Name:
<input type=”text” name=”name” size=”20″>
<br>
<br>
E-mail:
<input type=”text” name=”email” size=”20″>
<br>
<br>
Message:<br>
<textarea rows=”9″ name=”message” cols=”30″>
</textarea>
<br>
<br>
<input type=”submit” value=”Send” name=”submit”>
</form>
</center>
</body>
</html>

To have the form working you will also have to create a file called mailer.php with the below code:

<?php
if(isset($_POST['submit'])) {

$myemail = “youremail@yourdomain.com”;
$subject = $_POST['subject'];
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$headers = “From:Contact Form <$myemail>\r\n”;
$headers .= “Reply-To: $name <$email>\r\n”;

echo “Your message has been sent successfully!”;
mail($myemail, $subject, $message, $headers);

} else {

echo “An error occurred during the submission of your message”;

}
?>

If you already have a non-working contact form try adding the following variables and check if it works:

$mymail = “youremail@yourdomain.com”;
$headers = “From:Contact Form <$myemail>\r\n”;
$headers .= “Reply-To: $name <$email>\r\n”;
mail($mymail, $subject, $message ,$headers);

NOTE: The Reply-To header could be set with different variable than $email, depending on the contact form itself.

If your contact form already has the $header or $headers variable you will have to add the code with the following change:

$mymail = “youremail@account.com”;
$headers .= “From:Contact Form <$myemail>\r\n”;
$headers .= “Reply-To: $name <$email>\r\n”;
mail($mymail, $subject, $message ,$headers);

NOTE: The Reply-To header could be set with different variable than $email, depending on the contact form itself.

If you wish the messages from the contact form to be received in e-mail box which is not on our servers just replace the $mymail in the mail() function with the e-mail where the e-mails should be sent to.

How can I access my Webmail? No comments yet

Answer: You can access your webmail from the control panel, if you follow the instructions:

1. Login to your control panel.
2. Go to E-Mail Manager.
3. Click on Webmail.

You wil be forwarded to a login screen from where you can manage your emails via your web browser.

How can I add an e-mail alias? No comments yet

Answer: To add an e-mail alias, you should follow the instructions below:

1. Login to your control panel. 2. Go to E-Mail Manager.
3. Click on E-mail Aliases.

You will be forwarded to a page where you will find a list of your current e-mail aliases.. To add the alias, you will have to complete the form.

I’m having trouble setting up an email account in Thunderbird, what are the correct settings? No comments yet

Answer: Delete the email account you have already set up, start again and follow these steps:

  1. Tools -> Account Settings
  2. Add Account -> New Account Setup -> Choose Email account
  3. Identity:
      • Your Name: Firstname Lastname
        • Email address: name@domain.com
        1. Server Information:
            • Choose IMAP
              • Incoming Server: mail.yourdomain.com
              1. User Names:
                  • name@yourdomain.com
                  1. Account Name:
                      • name@yourdomain.com
                      1. Finish -> OKThunderbird might ask you for email account password, enter it.
                      2. Inside your Thunderbird right click on the email account -> choose Properties
                      3. Dialog box will open, go to Server Settings -> click on ‘Advanced’ button
                      4. Second dialog box will open, in IMAP server directory write: INBOX, click Ok on the second dialog box
                      5. On the first dialog box on the left below find -> Outgoing Server (SMTP), click on and choose ‘Add’
                      6. A dialog box will open with title ‘SMTP Server’ enter the following settings:Settings:
                          • Description: name@domain.com
                            • Server Name: mail.domain.com
                              • Port 25

                                Security and Authentication:

                                  • Check box ‘Use name and password’ should be checked.
                                    • Username: name@yourdomain.com

                                    Confirm all dialog boxes with OK, close Thunderbird and reopen it again. You may be asked for your password again, place the password and check the box to save it.

                                    This is the whole process of setting up an email account with Thunderbird.

                                    How to set up email forwarding? No comments yet

                                    Answer: To set up forwarding for all emails coming to any@yourdomaindomain.com to be forwarded any@anydomain.com, do the following:

                                    1. Go to your Control Panel -> E-mail Manager section -> E-mail Filters menu;
                                    2. If you want all emails sent to any@yourdomaindomain.com to be forwarded to any@anydomain.com, these are the correct settings in the E-mail Filters menu:

                                      E-mail: any@anydomain.com (choose from the drop down menu)

                                      Rule description: any@anydomain.com type any explanation for this rule

                                      Filter priority: any not already taken from 1 to 500, start from 1

                                      Set filter criteria: ‘Addressed To’ ,type any@anydomain.com

                                      Action to be taken: ‘Forward message to e-mail’ any@anydomain.com

                                    If you want the emails sent to any@yourdomaindomain.com, to be forwarded to any@anydomain.com, and in the same time kept in any@anydomaindomain.com as well, you should specify all emails to be forwarded to any@anydomain.com as well as any@anydomaindomain.com, space delimited.

                                    I am unable to use PHP mail() function from my paid hosting account, why? No comments yet

                                    Answer: Here is a script example you can test php mail function with:

                                    <?
                                    $from = “From: You <you@yourdomain.com>”;
                                    $to = “you@yourdomain.com”;
                                    $subject = “Hi! “;
                                    $body = “TEST”;

                                    if(mail($to,$subject,$body,$from))
                                    echo “MAIL – OK”;
                                    else
                                    echo “MAIL FAILED”;
                                    ?>

                                    This script is sending email (to you@yourdomain.com) and printing “MAIL – OK” on the page.

                                    Please note that the ‘from’ header should be an existing email account inside your Email Manager of your hosting Control Panel.

                                    I can’t send e-mails. It seems that the POP3/IMAP connection is not working. Please help? No comments yet

                                    Answer: In order to check, if your email client does connect to POP3, please observe the following steps:

                                    1. Open command prompt from -> Start button -> Run -> type cmd, a black dialog box will open the so called Command Prompt
                                    2. Type in -> telnet mail.yourdomain.com 110 -> press ‘Enter’

                                    You should receive – OK status, this means POP3 is working and connection is ok to the mail server.

                                    In order to check if your email client does connect to IMAP, do the following:

                                    1. Open command prompt from -> Start button -> Run -> type cmd, a black dialog box will open, this is the so called command prompt
                                    2. Type in -> telnet mail.yourdomain.com 143 -> press ‘Enter’

                                    You should receive – OK status, this means IMAP is working and connection is ok to the mail server.

                                    I can’t send e-mail. The error I receive is ‘Outlook is unable to connect to your outgoing (SMTP) e-mail server. If you continue receiving this message, contact your server administrator or Internet service provider (ISP).’ No comments yet

                                    Answer: First make sure you have checked in the account properties of the Outlook Express / MS Outlook the option ‘My server requires authentication’. Please note that if you are using different e-mail client the settings might be different.

                                    If not, proceed to the following test. Open Command Prompt and type: telnet mail.yourdomain.com 25, press ‘Enter’

                                    If you do not get response ‘220 mail.yourdomain.com mail server’ this means your PC (Firewall or Antivirus Program) blocks port 25 and thus filters your outgoing emails.

                                    Solution: Disable the option of your/your network firewall to block port 25, contact system administrator, ISP or Antivirus Program producer for help on how to disable port 25 filtering. Alternatively you may use port 587.

                                    What are my POP3/IMAP settings to configure it with email client? No comments yet

                                    Answer:

                                    The mail settings are as follows:
                                    Username: Your e-mail address;
                                    Password: Your e-mail password;
                                    POP3 Server: yoursubdomain.yourdomainname.com or mail.yourdomainname.com
                                    SMTP Server: if you have paid account use mail.yourdomainname.com;

                                    SMTP (Simple Mail Transfer Protocol) is disabled for all free accounts due to spam concerns.

                                    I can’t send e-mail. All outgoing e-mails are being rejected. Why? No comments yet

                                    Answer: SMTP is disabled for the free accounts due to spam concerns.

                                    If you have a paid account, please make sure in the account properties of the Outlook Express / MS Outlook you have checked the box ‘My server requires authentication’. Please note that if you are using different e-mail client the settings might be different ( please refer to Question 9 further below ).

                                    Top of page / Subscribe to new Entries (RSS)