Jump to content

Recommended Posts

Downloaded it and installed it, but i have something setup wrong i guess. When ever I try to use

[code]
<?
$to = '<me>@hotmail.com';
$subject = 'test';
$message = 'test';
$headers = "From: \r\n" .
      'X-Mailer: PHP/' . phpversion() . "\r\n" .
      "MIME-Version: 1.0\r\n" .
      "Content-Type: text/html; charset=utf-8\r\n" .
      "Content-Transfer-Encoding: 8bit\r\n\r\n";

// Send
mail($to, $subject, $message, $headers);
?>
[/code]

I get the error message
Warning: mail() [function.mail]: SMTP server response: 550 550 Delivery is not allowed to this address. in Y:\public_html\common\mail.php on line 12
Link to comment
https://forums.phpfreaks.com/topic/14217-mail-server/#findComment-55896
Share on other sites

I am not familiar with that server but this means that you have not enabled send fake mail in your php.ini
I use Mecury Mail Server on Windows.

Try this and see if it works. I don't think that you will be able to send html mail with it though

[code=php:0]<?php
$knownsender = "you@yourdomain.com"; // this has to be an authorized account on your server
$mailtos = "$to"; // who ever this email is being sent to
$subject = "your subject";
$message = "Dear Web Master,
    You have received a message from someone at OWPT.
   
    Frist Name: $first_name
    Last Name: $last_name
    Email Address: $email
   
    The message is:

$body 
   
    Thanks!
    WebMaster, Owpt.biz
   
    This is an automated response, please do not reply!";

if ($ccaddress=="" || $ccaddress==" ")
{
$header="From: $knownsender";

}
else
{
$header .="From: $knownsender\r\n";
$header .=" Cc: $ccaddress";
}
// $header.="Bcc: $bcaddress";

if (@mail($mailtos, $subject, $message, $header))
{
$message ="success";
include("contact.php");
}
else
{
$message ="error";
include("contact.php");
}
?>[/code]

This is an example of the sendmail.php for one of my sites. All you do is create a form that posts the data to this. Like I said I am not sure if this will work for your mail server or not but it is worth a try.

here is an example of the form that posts to it

[code=php:0]<?php
$filename = "contact.php";
$title = "Contact Us";
if ($message =='success') {
  $text ="Your message has been sent and we will reply shortly";
}elseif ($message =='error') {
  $text ="There was an error in creating your message";
}else{
  $text ="";
}       
$content = "
  <div class=\"feature\">
  <p>
    <h3>Contact Us</h3>
  </p>
  <p><b>$text</b></p>
    <form method=\"POST\" action=\"send.php\">
<p>&nbsp;&nbsp;First Name&nbsp;&nbsp;<input type=\"text\"  name=\"first_name\" id=\"first_name2\"></p>
<p>&nbsp;&nbsp;Last Name&nbsp;&nbsp;<input type=\"text\"  name=\"last_name\" id=\"last_name\"></p>
<p>&nbsp;&nbsp;Your Email&nbsp;&nbsp;<input type=\"text\"  name=\"email\" id=\"email\"></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Subject&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select size=\"1\" name=\"D1\" multiple><option></option><option></option><option></option><option></option><option></option></select></p>
<p>&nbsp;&nbsp;<textarea cols=\"38\" rows=\"10\" name=\"body\"></textarea></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"submit\"  name=\"Submit\" value=\"Send\"></p>
    </form>
  </div>";
include("includes/main.php")
?>[/code]

You can edit the structure to fit your page
Link to comment
https://forums.phpfreaks.com/topic/14217-mail-server/#findComment-55902
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.