Mail send Error Either Cant Connect or Server Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
saeen
Forum Newbie
Posts: 24
Joined: Mon Sep 22, 2003 5:35 am
Contact:

Mail send Error Either Cant Connect or Server Error

Post by saeen »

hi thr
i have this pdf file i want to email .. this pdf file is generated dynamically.. i want to send it without saving the file...once the file is generated in a variabble like $pdf i want to email it rite away..for now i have saved the file and im sending it like this:
$content_type = "application/pdf";
$fd = fopen($filename, "r");
$data = fread($fd, filesize($filename));
fclose($fd);

$mail = new mime_mail;
$mail->from = "me@domain.com";
$mail->to = $email;
$mail->subject = "YLC Registration";
$mail->body = "Thank You for registering with us. Please download the attached .pdf invitation.";

$mail->add_attachment($data, $filename, $content_type);
$mail->send();

but this gives me two different types of errors
Warning: Failed to Connect in C:\apache\htdocs\ylc\php\mime_mail.inc on line 99
this is one of them i think this is coz of the smtp server defined in php.ini well i have tried different ones but it doesnt work...can any one tell me how to fix it or jus temme any smtp server that wud jus lemme send a mail to test if it works r not
plz help
Post Reply