Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP & CDONTS (massive emails)

Status
Not open for further replies.

BigTeeJay

Technical User
Jun 13, 2001
106
US
Hey,
I was have a Win2k Pro based box, using IIS and PHP/ASP.
I was trying to get mail sending up & working, and read
about he CDONTS email object available via IIA.

I found this code (ASP)...
(<%
Dim MyBody
Dim MyCDONTSMail

Set MyCDONTSMail = CreateObject(&quot;CDONTS.NewMail&quot;)
MyCDONTSMail.From= &quot;somebody@nowhere.com&quot;
MyCDONTSMail.To= &quot;nobody@nowhere.com&quot;
MyCDONTSMail.Subject=&quot;This is a Test&quot;
MyBody = &quot;Thank you for ordering that stuff&quot; & vbCrLf
MyBody = MyBody & &quot;We appretiate your business&quot; & vbCrLf
MyBody = MyBody & &quot;Your stuff will arrive within 7 business days&quot;
MyCDONTSMail.Body= MyBody
MyCDONTSMail.Send
set MyCDONTSMail=nothing
%>

and then this code (PHP)...
(?php

@$CDONTS = new COM(&quot;CDONTS.NewMail&quot;);

@$CDONTS->From = &quot;from_user@domain.com&quot;;
@$CDONTS->To = &quot;to_user@domain.com&quot;;
@$CDONTS->CC = &quot;cc_user@domain.com&quot;;
@$CDONTS->BCC = &quot;bcc_user@domain.com&quot;;

@$CDONTS->BodyFormat = 0;
@$CDONTS->MailFormat = 0;

@$CDONTS->Subject = &quot;This is a sample subject string&quot;;
@$CDONTS->Body = &quot;This is the body of an email, blah blah blah, bleh&quot;;
@$CDONTS->AttachFile(&quot;c:\file.txt&quot;);

@$CDONTS->Send();
@$CDONTS->Close();

print &quot;mail sent&quot;;
?>

The problem is, when viewing either of the pages, I end
up with 1000+ emails being queued up, and thats after
I recieved over 200 emails.

I usually have to end up rebooting the server (if I stop
it, clear the queue, and restart it, it just queues up
a bunch more).

Any one have a similiar problem? Since it happens when used
with ASP or PHP, it doesnt seem to be the way I am calling
it so much as maybe IIS/CDONTS. But I doubt anyone in an
IIS forum would be able to help (they would probably say its
the app, not the web/mail server).

Regards,
Tj
 
Try getting rid off the @ before every line and seeing what error messages come up. If you've got a problem, it doesn't make sense to stop it telling you what the problem is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top