Solved

Email with no subject or body text

Posted on 2014-12-22
11
110 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Zimbra is famous for its platform independency, ability to manage multiple user accounts, easy assimilation with 3rd party applications, social network certification etc. Here, we discuss about how users can move multiple Zimbra user accounts to Exc…
Explore the encryption capabilities built into Google Apps and how these features can help you meet privacy policy and regulatory compliance, but are not a full solution. Understand and compare the most popular email encryption services for Google A…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 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