PHPMailer File Attachment to Big

I am trying to $object -> Attachment('directory/file.pdf'); attach a pdf file to an email being sent out using the PHPMailer class script. The pdf file is almost 4mb, and after testing with other files I've come to the conclusion the pdf file is to large. Needless to say, the PHPMailer script is timing out, and I don't even receive the email when trying to send the 4mb file attached email.

Currently I am using $object->IsSMTP because our testing server is running IIS Web Server on a Windows OS. The LIVE server is UNIX and i can use $object->IsMail . What are some solutions to my problem to getting it work for the above cases?

LVL 11
Andrew AngellCo-Owner / DeveloperAsked:
Who is Participating?
Andrew AngellConnect With a Mentor Co-Owner / DeveloperAuthor Commented:
The problem is that the IIS Virtual Mail Server had a email size limit set at 2048KB. I set it to 7000KB for testing purposes.
jmyeomConnect With a Mentor Commented:
try setting the php script to never time out...

also, it may be that your BROWSER it timing it out, if so, see if you can make the script echo something to the screen somehow, im not sure how you would do this, if it the file taking to long, im sure it would hold there and not continue, what i normal do is just make it keep echoing numbers, this will stop it timing out and you can see what part the script is stopping at...

Andrew AngellCo-Owner / DeveloperAuthor Commented:
Jmyeom, I've actually already tried to set_time_limit to 300 which would be 5 minutes, and that would be more then enough time. The script is actually a Instant Payment Notification (IPN) and a website service (PAYPAL) hits it. So, without writing some small test forms I can't just go to the URL to test it. I might have to do that here in a second unless somebody comes up with a quick solution.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.