CDO to mail() question

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
Milan
Forum Commoner
Posts: 97
Joined: Wed May 17, 2006 6:08 pm

CDO to mail() question

Post by Milan »

What is the best way to convert this to mail()

Code: Select all

$message=new COM('CDO.Message');
    $messageCon=new COM('CDO.Configuration');
    $messageCon->Fields['http://schemas.microsoft.com/cdo/configuration/smtpserver']->value=$smtpserver;
    $messageCon->Fields['http://schemas.microsoft.com/cdo/configuration/smtpserverport']->value=$portnum;
    $messageCon->Fields['http://schemas.microsoft.com/cdo/configuration/sendusing']->value=2;
    $messageCon->Fields['http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout']->value=60;
    $messageCon->Fields->Update();
    $message->Configuration = $messageCon;
    $message->To = $sendtoadr;
    $message->From = $fromadr;
    $message->Subject = $fmsubject;
    $message->HTMLBody = $mstext;
    $message->Send() ;
thanks !
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Mail is a very very simple function. Check out the manual...

mail()
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

You also might want to check out the excellent Swift Mailer class from one of our members (who is providing great support -- until he becomes famous ;)) and also the popular phpMailer class.
(#10850)
Milan
Forum Commoner
Posts: 97
Joined: Wed May 17, 2006 6:08 pm

Post by Milan »

Swift Mailer class worked great!

thanks!
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Great. Definitely give d11wtq any feedback you have on those classes.
(#10850)
Milan
Forum Commoner
Posts: 97
Joined: Wed May 17, 2006 6:08 pm

Post by Milan »

will do!

(tested on godaddy.com with huuuuuuge e-mail files and lists...)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

arborint wrote: -- until he becomes famous ;)
:lol:
Post Reply