PHP Classes

not work

Recommend this page to a friend!

      MIME E-mail message sending  >  All threads  >  not work  >  (Un) Subscribe thread alerts  
Subject:not work
Summary:not work
Messages:8
Author:Anatoly
Date:2006-09-17 16:00:47
Update:2006-09-19 02:22:09
 

  1. not work   Reply   Report abuse  
Picture of Anatoly Anatoly - 2006-09-17 16:00:47
i'm use:

$from_name=getenv("kamyshew");
$from_address=getenv("kamyshew")."@".getenv("admin");
$reply_name=$from_name;
$reply_address=$from_address;
$reply_address=$from_address;
$error_delivery_name=$from_name;
$error_delivery_address=$from_address;
$to_name="admin";
$to_address="kamyshew@nm.ru";
$subject="Testing Manuel Lemos' MIME Email composition PHP class: some non-ASCII characters БиОхЬ in a message header";
$message="Hello ".strtok($to_name," ").",\n\nThis message is just to let you know that your e-mail sending class is working as expected.\n\nHere's some non-ASCII characters БиОхЬ in the message body to let you see if they are sent properly encoded.\n\nThank you,\n$from_name";
$email_message=new email_message_class;
$email_message->SetEncodedEmailHeader("To",$to_address,$to_name);
$email_message->SetEncodedEmailHeader("From",$from_address,$from_name);
$email_message->SetEncodedEmailHeader("Reply-To",$reply_address,$reply_name);
/*
Set the Return-Path header to define the envelope sender address to which bounced messages are delivered.
If you are using Windows, you need to use the smtp_message_class to set the return-path address.
*/
if(defined("PHP_OS")
&& strcmp(substr(PHP_OS,0,3),"WIN"))
$email_message->SetHeader("Return-Path",$error_delivery_address);
$email_message->SetEncodedEmailHeader("Errors-To",$error_delivery_address,$error_delivery_name);
$email_message->SetEncodedHeader("Subject",$subject);
$email_message->AddQuotedPrintableTextPart($email_message->WrapText($message));
$error=$email_message->Send();
if(strcmp($error,""))
echo "Error: $error\n";

php error:
Warning: mail() [function.mail]: SMTP server response: 501 Mailbox syntax incorrect - <admin <kamyshew@nm.ru>> in D:\xampp\htdocs\avia\classs\email_message.class.php on line 356
server respondent:
>17.09.2006 19:55:00 SMTPSERV 0001 RCPT TO:<admin <kamyshew@nm.ru>>
<17.09.2006 19:55:00 SMTPSERV 0001 501 Mailbox syntax incorrect - <admin <kamyshew@nm.ru>>


  2. Re: not work   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-09-17 16:50:01 - In reply to message 1 from Anatoly
You should use:

$from_name="admin";
$from_address="kamyshew@nm.ru";

  3. Re: not work   Reply   Report abuse  
Picture of Anatoly Anatoly - 2006-09-18 12:38:00 - In reply to message 2 from Manuel Lemos
i'm use:
$from_name="kamyshew";
$from_address="kamyshew@admin";

$to_name="admin";
$to_address="admin@admin";

Warning: mail() [function.mail]: SMTP server response: 501 Mailbox syntax incorrect - <admin <admin@admin>> ...

If use:
mail('admin<admin@127.0.0.1>', "", "test");

server reply:
<18.09.2006 16:29:49 SMTPSERV 000A 250 OK - mail from <admin@admin>

  4. Re: not work   Reply   Report abuse  
Picture of Anatoly Anatoly - 2006-09-18 12:40:04 - In reply to message 3 from Anatoly
sorry:
mail('admin@127.0.0.1', "", "test");

  5. Re: not work   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-09-18 16:55:31 - In reply to message 4 from Anatoly
It seems there is a problem with your mail system or PHP version.

Instead of

$email_message->SetEncodedEmailHeader("To", $to_address, $to_name);

try using just:

$email_message->SetHeader("To", $to_address);

  6. Re: not work   Reply   Report abuse  
Picture of Anatoly Anatoly - 2006-09-18 18:16:29 - In reply to message 5 from Manuel Lemos
My PHP version 5.0.5 & 4.4.1 Windows XP(local test)
php 4.4.1 OS Free BSD(Web server in net)
Class tested on this system's.

I'm sorry for my English language.

  7. Re: not work   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-09-18 19:17:31 - In reply to message 6 from Anatoly
Those PHP versions are buggy. They have problems dealing with arrays. It may not be your problem, but you may want to try newer versions to make sure that is not causing the problem.

  8. Re: not work   Reply   Report abuse  
Picture of Anatoly Anatoly - 2006-09-19 02:22:09 - In reply to message 7 from Manuel Lemos
>try using just:

>$email_message->SetHeader("To", $to_address);

it's work, all Ok.

Thank you very much.