Email with no subject or body text

I have a need to generate an email on a web server using php that has no subject line or message body text but has an attachment.

This is to send an email directly to an HP printer using an HP service; doing it in this way will allow the email attachment to be directly printed.

I have been using SendGrid; it does everything fine EXCEPT it requires a subject & email text, which still works but prints an extra page on the printer with the text message.

Does someone know of an alternate way that will NOT require a subject or body?

Thanks
Richard KortsAsked:
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.

Marco GasiFreelancerCommented:
I don't know SendGrid, but AFAIK with PHPMailer and the mail() function itself you can just set subject and body to empty strings.
0
Richard KortsAuthor Commented:
What is AFAIK?

I know I used phpMailer in the past; there were issues, I can't remember the details.

Thanks
0
Richard KortsAuthor Commented:
Never mind, I found out it's an internet acronym.
0
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

Marco GasiFreelancerCommented:
I didn't replay because I was away. PHpMailer issues? No software is perfect, but PHpMailer is for sur one of the bet choices to send email via php... I can't figure out what it could be the problem... Anyway, good luck with your project.
Cheers
0
hieloCommented:
>> which still works but prints an extra page on the printer with the text message.
If the issue with that extra page is that it contains the text message, have you tried setting the subject and body to a space character (ASCII 32) so that you only get a blank page.

Alternatively, the following may help you:
http://www.finalwebsites.com/forums/topic/php-e-mail-attachment-script
0
Richard KortsAuthor Commented:
To Marco Gasi,

I'm setting up to try it now.

Customer office (where printer is) is closed until Jan. 6, so I won't know till then.

Thanks
0
Marco GasiFreelancerCommented:
Well, we'll wait until 7 january. Merry Christmas and Happy New year. :-)
0
Richard KortsAuthor Commented:
To hielo,

They don't want a blank page, that is part of the issue.

Plus, with SendGrid, they don't allow what you suggested; I asked them that specifically last week.
0
Richard KortsAuthor Commented:
To Marco Gasi,

I set up a test with a blank message body; test code attached.

I get this:

entered test mail
bottom of test mail
Mailer Error: Message body empty

So I deduce that phpmailer cannot send with a blank body.

Any one else with ideas?

Thanks.
phpmailer-ex1.php
0
hieloCommented:
>>Any one else with ideas?
Did you try the using mail() as in the link I posted above?
0

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
Richard KortsAuthor Commented:
That seems to work!

Thanks.
0
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
Internet / Email Software

From novice to tech pro — start learning today.