Jump to content

how to send mail use socket


zjp

Recommended Posts

I am not sure what you mean but here is a standard script for sending mail.

[code]$to = '$email_address';//the email address that you are sending to
    $subject = 'Your subject
    $message = '$This is were you type your email address';
    $headers = "From: your email_address
      '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";
    mail($to, $subject, $message, $headers)or die('something went wrong');
    echo 'Your mail has been sent';[/code]

You should try to be more descryptive about your issue. I, for instance, have my own server and use the Mecury Mail Server, which has issues sending mail via php. The standard X-mailer will not work.
or maybe you could try this

[code]$knownsender = "your email";
$mailtos = "sending to email";
$subject = "Your subject";
$message = "enter your message here";
   
   
}
if ($ccaddress=="" || $ccaddress==" ")
{
$header="From: $knownsender";

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

if (@mail($mailtos, $subject, $message, $header))
{
echo "Your mail sent success message";
}
else
{
echo "Your error message.";
}[/code]

Maybe this would be better for you.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.