| |
|
| |
| Home
>
Support Home
>
knowledgebase >
PHP
SMTP Sendmail setup |
| |
If you are using PHP to send
email from your website, you will need to make sure you add this
code to your website. |
| |
<?php
// == SET VARIABLES =========================
// == Set variables to get submitted form
// == values. $body = Message body, combines
// == recieved values into readible format.
// ==========================================
$name = $_REQUEST["name"];
$email = $_REQUEST["email"];
$subject = $_REQUEST["subject"];
$msg = $_REQUEST["msg"];
$body="Somebody sent an email from the website. Read what they
wrote below.
Name: ".$name."
Email: ".$email."
Subject: ".$subject."
Message: ".$msg;
// == SET SERVER VARIABLES ==================
ini_set("SMTP","mail.your-domain-name.com");
ini_set("smtp_port",25);
ini_set("sendmail_from","you@your-domain-name.com");
// == SET EMAIL PROPERTIES AND SEND =========
if(mail( "sendemail@otherplace.com", "Subject",$body)){
echo 'Email sent successfully!';
}
else{
echo 'An error occured. The email was not sent.';
}
?> |
|
| |
|
|
|