1

Topic: Mail sending

I try to send
PHP
To select the code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$to = "areostar@gmal.com";
$subject = "This is subject";
$message = "<b> This is HTML message. </b>";
$message. = "<h1> This is headline. </h1>";
$header = "From:support@stoxmarket.com \r\n";
$header. = "Cc:afgh@somedomain.com \r\n";
$header. = "MIME-Version: 1.0\r\n";
$header. = "Content-type: text/html\r\n";
$retval = A mail ($to, $subject, $message, $header);
if ($retval == true) {
echo "Message sent successfully...";
}
else
{
echo "Message could not be sent...";
}
Mail does not go!

2

Re: Mail sending

Sorry, forgot the code to select.  !

3

Re: Mail sending

Areostar;
Try PHPMailer .

4

Re: Mail sending

DarkMaster;
Certainly

require_once (' class.phpmailer.php ');
$mail = new PHPMailer ();//defaults to using php "A mail ()"
$mail-> IsSendmail ();//telling the class to use SendMail transport
//$body = file_get_contents (' contents.html ');
//$body = eregi_replace ("[\]",", $ body);
//$mail-> AddReplyTo ("name@yourdomain.com", "First Last");
$body = "Test Mail";
$mail-> SetFrom (' support@stoxmarket.com ', ' stoxmarket support ');
//$mail-> AddReplyTo ("name@yourdomain.com", "First Last");
$address = "areostar@gmail.com";
$mail-> AddAddress ($address, "Anton anton");
$mail-> Subject = "PHPMailer Test Subject via Sendmail, basic";
$mail-> AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail-> MsgHTML ($body);
//$mail-> AddAttachment ("images/phpmailer.gif");//attachment
//$mail-> AddAttachment ("images/phpmailer_mini.gif");//attachment
if (! $mail-> Send ()) {
echo "Mailer Error:". $mail-> ErrorInfo;
}
else {
echo "Message sent!";
}

Result: Mailer Error: Could not execute:/usr/sbin/sendmail-t-i
On it I also suspected malfunctions on the server!

5

Re: Mail sending

Areostar wrote:

result: Mailer Error: Could not execute:/usr/sbin/sendmail-t-i
On it I also suspected malfunctions on the server!

Respected, you asked the manager of the server and he to you told, what it is necessary to send mail through "/usr/sbin/sendmail-t-i"?
If yes, problems on the server, and here if are not present, malfunctions in the thinking should be considered... smile.

6

Re: Mail sending

Understood! Created on a host a mail account, from it  norms it is delivered!