Пращане на mail

  • Автор Автор ivo75
  • Начална дата Начална дата
Какво по точно те интересува php кода за изпращане на емайл или майл сървъра.
 
PHP кода. Намерих ето този код и работи.

Код:
<?php
//define the receiver of the email
$to = 'youraddress@example.com';
//define the subject of the email
$subject = 'Test email'; 
//define the message to be sent. Each line should be separated with \n
$message = "Hello World!\n\nThis is my first mail."; 
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
//send the email
$mail_sent = @mail( $to, $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" 
echo $mail_sent ? "Mail sent" : "Mail failed";
?>
 
Значи да разбирам че smtp сървър ти трябва? Ако е така кажи с каква OS работиш. Ако си с Linux инсталираи sendmail и ще стане. За Windows тук в форума маи имаше някъкъв урок за инсталиране и настройка на smtp сървър.
 

Back
Горе