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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
Andrew AngellCo-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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.