Solved

Email with no subject or body text

Posted on 2014-12-22
11
108 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 31

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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 31

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
 

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 31

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Are you using email marketing software? If not, you're missing out on effortless marketing and the reaching of desired conversion rates through email marketing software.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

829 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