IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sending mail through mainframe in HTML


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ashish Shinde

New User


Joined: 16 Feb 2011
Posts: 5
Location: Pune

PostPosted: Wed Feb 16, 2011 4:37 pm
Reply with quote

I tried to send the HTML email using mainframe. Mail is being sent in text format not in HTML.
rather than converting HTML code to particular format its sending it as a text.

Can someone help me out and tell me what needs to be changed in order to get the mail in proper HTML format.

this is my JCL:-
Code:
//SMTP     EXEC PGM=IEBGENER       
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY,DCB=BLKSIZE=80
//SYSUT2   DD SYSOUT=(L,SMTP)
//SYSUT1   DD *
HELO MVSLP0
MAIL FROM: <MY EMAIL ID>
RCPT TO: <MY EMAIL ID>
DATA
DATE: MON, 14 FEB 11 07:35:00 EST
FROM: <MY EMAIL ID>
TO: <MY EMAIL ID>
SUBJECT: SMTP TEST
MIME-VERSION: 1.0
CONTENT-TYP: TEXT/HTML:
<HTML>
<HEAD>
<TITLE>THIS IS TITLE</TITLE>
</HEAD>
<BODY>
THIS IS BODY
</BODY>
</HTML>


any help will be appreciated
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 17, 2011 3:59 am
Reply with quote

What are you seeing in the mail client, and what do you expect to see? I ran a test based on your HTML code and get
Code:
THIS IS BODY
for the email text, exactly as expected.
Back to top
View user's profile Send private message
Ashish Shinde

New User


Joined: 16 Feb 2011
Posts: 5
Location: Pune

PostPosted: Thu Feb 17, 2011 4:25 pm
Reply with quote

I am seeing all HTML statements which i have written in JCL as it is in the mail in text format.

Below is the data in may mail:-

<HTML>
<HEAD>
<TITLE>THIS IS TITLE</TITLE>
</HEAD>
<BODY>
THIS IS BODY
</BODY>
</HTML>

however i want to see only "THIS IS TITLE" in title format and "THIS IS BODY" in the body of mail.

I hope you are getting me. for example if my statement in JCL is
<b> Bold statement</b>
then i should see "Bold statement" in bold but the mail which i receive is having <b> Bold statement</b> as it is.

I want to know what changes i need to change in JCL to achive that or do i need to change some settings in my outlook. I am using Outlook 2007.

Your help will really be appreciated.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 17, 2011 5:20 pm
Reply with quote

1. You will not see THIS IS TITLE in an email -- an email client is not a web browser and does not behave the same way.

2. Your mail client may -- or may not -- allow you to use things like bold in an HTML emaill. Only reading the documentatio will tell you for sure. If not, nothing you can do on the mainframe will cause you to have bold text in the email.

3. The specific SMTP data I used is:
Code:
HELO MAINFRAME.xxxx.COM
MAIL FROM: <MAINFRAME@xxx.COM>
RCPT TO: <ROBERT.SAMPLE@xxx.COM>
DATA
FROM:     MAINFRAME@xxx.COM
TO:       ROBERT.SAMPLE@xxx.COM
DATE:     FEBRUARY 16, 2011
SUBJECT:  TEST HTML
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/HTML

<HTML>
<HEAD>
<TITLE>THIS IS TITLE</TITLE>
</HEAD>
<BODY>
THIS IS BODY
</BODY>
</HTML>
and only THIS IS BODY showed up in the email.

4. If you're doing things like this, you need to find and read RFC 2821, RFC 2822, RFC 2045, RFC 2046, and RFC2047 completely and thoroughly to understand what can -- and cannot -- be done with SMTP and MIME. In particular, your original post had CONTENT-TYP and either this was a mistake in copying -- shame on you if so -- or a mistake in the original JCL in which case MIME will not recognize the information.
Back to top
View user's profile Send private message
Ashish Shinde

New User


Joined: 16 Feb 2011
Posts: 5
Location: Pune

PostPosted: Thu Feb 17, 2011 5:43 pm
Reply with quote

I am sorry for creating confusion in CONTENT-TYPE.
Actually while posting my query, while removing unwanted spaces E got deleted from there. I apologize.

Actually i came to know that it is possible to send mails with formatting fonts or colours through mainframe.
I came to know it from below link:-

www.mainframezone.com/it-management/sending-html-email-from-your-mainframe

I am sure whether it is correct or not but as per the description, they have implemented it in their system.

could you please suggest ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 17, 2011 6:23 pm
Reply with quote

As I said in my earlier post, the SMTP commands I posted worked perfectly well to send an HTML email. Have you tried that exact set of SMTP commands yet?
Back to top
View user's profile Send private message
Ashish Shinde

New User


Joined: 16 Feb 2011
Posts: 5
Location: Pune

PostPosted: Thu Feb 17, 2011 6:36 pm
Reply with quote

Yes i tried those SMTP commands and that is working fine.
I also got mail as THIS IS BODY. Your code is perfectly working !!!

My last doubt is as per you, mail client may not allow to use things like bold or colour in an HTML emaill. I found description on the given link that it is possible and they have implemented it.

Is it possible through any way using mainframe ?

I posted my query on that link but didnt get any reply on that.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 17, 2011 7:29 pm
Reply with quote

The only way to know for sure is to find the documentation for your mail client and read it . If your mail client does not support HTML mail (and while most do, not all do), nothing you can do on the mainframe is going to change that.
Back to top
View user's profile Send private message
Ashish Shinde

New User


Joined: 16 Feb 2011
Posts: 5
Location: Pune

PostPosted: Thu Feb 17, 2011 8:03 pm
Reply with quote

Ok. I will check the documents.

Thanks for all your help. It really helped me !!!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Feb 17, 2011 8:49 pm
Reply with quote

anyway sending HTML formatted emails might prevent people from seeing it!
Your organization is not supposed to force anybody to abide to it's standards
the safest thing for general use is to send only plain TEXT!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts How to Reformat a file using File Man... All Other Mainframe Topics 14
No new posts NDM getting stuck - mainframe/JCL All Other Mainframe Topics 13
No new posts mail attachment with excel format All Other Mainframe Topics 2
Search our Forums:

Back to Top