Solved

Email with no subject or body text

Posted on 2014-12-22
11
101 Views
Last Modified: 2015-01-04
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
0
Comment
Question by:Richard Korts
  • 6
  • 3
  • 2
11 Comments
 
LVL 30

Expert Comment

by:Marco Gasi
ID: 40513276
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
 

Author Comment

by:Richard Korts
ID: 40513282
What is AFAIK?

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

Thanks
0
 

Author Comment

by:Richard Korts
ID: 40513289
Never mind, I found out it's an internet acronym.
0
 
LVL 30

Expert Comment

by:Marco Gasi
ID: 40513358
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
 
LVL 82

Expert Comment

by:hielo
ID: 40513378
>> 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
The problems with reply email signatures

Do you wish that you could place an email signature under a reply? Well, unfortunately, you can't. That great Exchange/Office 365 signature you've created will just appear at the bottom of an email chain. What a pain! Is there really no way to solve this? Well, there might be...

 

Author Comment

by:Richard Korts
ID: 40513396
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
 
LVL 30

Expert Comment

by:Marco Gasi
ID: 40513419
Well, we'll wait until 7 january. Merry Christmas and Happy New year. :-)
0
 

Author Comment

by:Richard Korts
ID: 40513421
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
 

Author Comment

by:Richard Korts
ID: 40522195
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
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 40522426
>>Any one else with ideas?
Did you try the using mail() as in the link I posted above?
0
 

Author Closing Comment

by:Richard Korts
ID: 40530480
That seems to work!

Thanks.
0

Featured Post

Make managing Office 365 email signatures a breeze

Are you using Office 365? Having trouble trying to set up email signatures for your users? Getting stressed out managing multiple signatures? Need an easier way to manage? We have a solution for you, try the most-user friendly and powerful signature management tool on the market.

Join & Write a Comment

The biggest nightmare for any Exchange Server Administrator is to keep the server running without any issue. But the problems often come and they need to be resolved efficiently and timely. Here are important troubleshooting points: Define the Pr…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now