Page 1 of 1

Another way to send mail without mail()

Posted: Mon May 29, 2006 4:18 pm
by Milan
I found this online i tought it would be nice to share with you guys, i tried it and it works great.

Code: Select all

<?
    $message=new COM('CDO.Message');
    $messageCon=new COM('CDO.Configuration');
    $messageCon->Fields['http://schemas.microsoft.com/cdo/configuration/smtpserver']- >value='mail-v.SMTP.com';
    $messageCon->Fields['http://schemas.microsoft.com/cdo/configuration/smtpserverport']- >value=25;
    $messageCon->Fields['http://schemas.microsoft.com/cdo/configuration/sendusing']->value=2;
    $messageCon->Fields[' http://schemas.microsoft.com/cdo/config ... ontimeout']->value=60;
    $messageCon->Fields->Update();
    $message->Configuration = $messageCon;
    $message->To = "milan@mel.com";
    $message->From = "verificator@me.com";
    $message->Subject = "Hello";
    $message->HTMLBody = "Insert <b>Message</b>";
    $message->Send() ;
    ?>

Posted: Mon May 29, 2006 4:20 pm
by ianhull
Does the server it is running on need to have CDonts installed?

Thanks

not sure

Posted: Mon May 29, 2006 4:23 pm
by Milan
not sure but i tried it on fresh installation of windows 2000 server with IIS6 and it worked flawless

Posted: Mon May 29, 2006 4:36 pm
by ianhull
Well CDonts will not be installed with that installation so thats great.

Thanks for sharing

Posted: Mon May 29, 2006 4:38 pm
by pickle
FYI ~Milan - you've got an extra space in the line that sets the connection timeout.