Originally posted by jeff_borden
I can't get CDONTS to send the mail. Can someone tell me what I am missing here?
@$CDONTS = new COM("CDONTS.NewMail");
@$CDONTS->From = "mukulsabharwal@yahoo.com";
@$CDONTS->To = "jeff_borden@yahoo.com";
@$CDONTS->Subject = "COM rocks on PHP4";
@$CDONTS->BodyFormat = 0;
@$CDONTS->MailFormat = 0;
@$CDONTS->Body = "blah....";
@$CDONTS->Send();
@$CDONTS->Close();
print "mail sent";
Thanks
Well, I've never bothered with COM access via PHP before, but just looking at your CDONTS object, have you tried setting the body format and mailformat to 1 (both), just to get it started. Might be a good idea to see if it breaks first on plain-text mail before mucking with HTML/MIME mail.
But yeah, I can't see any reason why you shouldn't listen to barand and use mail().
Also, if you posted an error message or two, that might help us figure out what exactly is the problem.