Textarea as html body in email
Hi there,
I am trying to send an email within Apex (4.1.1.00.23) by putting the content
of a textarea (within a form) as html body.
However, the carriage returns and blanks are automatically erased and thus a text like this:
This
is a
Test!looks in the email like this
ThisisaTest!I was looking for a solution in this forum and tried to apply the hint of using the <pre> tags to keep the carriage returns and blanks in the following way:
l_body_html := '<pre>' || :P7_MESSAGE || '</pre>' ;However without success!
Am I missing something here?
Thanks in advance...
Johnny
Johnny Be Good wrote:
I am trying to send an email within Apex (4.1.1.00.23) by putting the content
of a textarea (within a form) as html body.
However, the carriage returns and blanks are automatically erased and thus a text like this:
This
is a
Test!looks in the email like this
ThisisaTest!I was looking for a solution in this forum and tried to apply the hint of using the <pre> tags to keep the carriage returns and blanks in the following way:
l_body_html := '<pre>' || :P7_MESSAGE || '</pre>' ;However without success!
Am I missing something here?Since the message content does not appear to be HTML, use the <tt>p_body</tt> parameter in <tt>apex_mail.send</tt> to send the mail as plain text.
Similar Messages
-
Embedded image in html body of the email is not appearing in Outlook mail box
My application Basically gets the un delivered emails from the outlook account.Composes the email from information then also appends the signature of email.The signatures may be multiple , form will show these signatures as a dropdown usin webbrowser control there both image as well as links appear well.But the same if draft them to outlook drafts folder the image in the signature misses and shows image not available.II fetch the signature from user local signature folder , convert it base64 string and set the string as source for image element and append this body of the email.I basically use Outlook COM object to achieve thesepublic void AddImageContentToHtml(List<TamDetails> tamList,string html,string key)
string htmlContent = html as string;
string imageSource = string.Empty;
HtmlNode signatureNode = null;
HtmlNodeCollection nodeCollection = null;
List<string> imagePaths = null;
string requiredImage = string.Empty;
string base64Image = string.Empty;
if (!string.IsNullOrWhiteSpace(key))
imagePaths = ImageDict[key];
foreach (string strPath in imagePaths)
//string appDataDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Microsoft\\Signatures";
requiredImage = strPath;
string [] commonPath = { Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Microsoft", "Signatures")};
string[] validPaths = requiredImage.Split(commonPath, StringSplitOptions.RemoveEmptyEntries);
if (validPaths.Count() > 1)
var path1 = commonPath[0];
var path2 = validPaths[1];
int index = path2.IndexOf('/');
path2.Remove(index);
requiredImage = path1 + path2;
if (!string.IsNullOrEmpty(requiredImage))
if (File.Exists(requiredImage))
base64Image = CreateBase64Image(requiredImage);
string fileExtension = Path.GetExtension(requiredImage);
imageSource = "data:image/" + fileExtension.Remove(0, 1) + ";base64," + base64Image;
if (!string.IsNullOrWhiteSpace(htmlContent))
try
HtmlDocument htmlDoc = new HtmlDocument();
if (!string.IsNullOrEmpty(imageSource))
htmlContent=htmlContent.Replace(requiredImage, imageSource);
htmlDoc.LoadHtml(htmlContent);
// HtmlNode node = new HtmlNode()
signatureNode = (htmlDoc.DocumentNode.Descendants("body").FirstOrDefault());
nodeCollection = signatureNode.ChildNodes;
catch (Exception ex)
AppLogException.LogError("Error in appending Signature Image", ex);
if (tamList != null)
tamList.ForEach(a =>
//StringWriter sw = new StringWriter(new StringBuilder(a.MailItem.HTMLBody));
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(a.SourceEmail);
var node = doc.DocumentNode.Descendants("div").FirstOrDefault();
if(nodeCollection != null && node != null)
foreach (var childNode in nodeCollection)
node.AppendChild(childNode);
a.MailItem.HTMLBody = doc.DocumentNode.OuterHtml;
//using(HtmlTextWriter htmlWriter = new HtmlTextWriter(sw,a.MailItem.HTMLBody))
// htmlWriter.RenderBeginTag(HtmlTextWriterTag.Div);
// if(!string.IsNullOrWhiteSpace(signatureNode))
// htmlWriter.
// htmlWriter.RenderEndTag();
}My mail html body is <html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 14">
<meta name=Originator content="Microsoft Word 14">
<link rel=File-List href="Sanjay%20S_files/filelist.xml">
<link rel=Edit-Time-Data href="Sanjay%20S_files/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<link rel=themeData href="Sanjay%20S_files/themedata.thmx">
<link rel=colorSchemeMapping href="Sanjay%20S_files/colorschememapping.xml">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:DoNotShadeFormData/>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
<w:UseFELayout/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
"Times New Roman";
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
"Times New Roman";
"Times New Roman";
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
"E-mail Signature Char";
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
"Times New Roman";
"Times New Roman";
span.E-mailSignatureChar
{"E-mail Signature Char";
"E-mail Signature";}
.MsoChpDefault
font-size:11.0pt;
"Times New Roman";
"Times New Roman";
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;
div.WordSection1
{page:WordSection1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{"Table Normal";
font-size:11.0pt;
font-family:"Calibri","sans-serif";
</style>
<![endif]-->
</head>
<body lang=EN-US style='tab-interval:.5in'>
<div
<p S<o:p></o:p></p>
<p
<p
<p gte vml 1]><v:shapetype id="_x0000_t75"
coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe"
filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:381.75pt;
height:63.75pt'>
<v:imagedata src="Sanjay%20S_files/image001.png" o:title="Signature"/>
</v:shape><![endif]--><![if !vml]><img width=509 height=85
src="Sanjay%20S_files/image001.png" v:shapes="_x0000_i1025"><![endif]><o:p></o:p></p>
<p
</div>
</body>
</html>Hi ssanjay.brillio,
According to your description, you'd like to send a email with an embedded image in the signature.
I suggest you sending the image in the last of the body of email instead of operating the signature of email.
The following example codes demonstrate how to send email using ImportHtml method with embedded images.
SmtpMail oMail = new SmtpMail("TryIt");
SmtpClient oSmtp = new SmtpClient();
// Set sender email address, please change it to yours
oMail.From = "[email protected]";
// Set recipient email address, please change it to yours
oMail.To = "[email protected]";
// Set email subject
oMail.Subject = "test HTML email with embedded image";
// Your SMTP server address
SmtpServer oServer = new SmtpServer("smtp.emailarchitect.net");
// User and password for ESMTP authentication, if your server doesn't require
// User authentication, please remove the following codes.
oServer.User = "[email protected]";
oServer.Password = "testpassword";
// If your smtp server requires SSL/TLS connection, please add this line
// oServer.ConnectType = SmtpConnectType.ConnectSSLAuto
try {
// Import html body and also import linked image as embedded images.
// 'test.gif is in c:\\my picture
oMail.ImportHtml("<html><body>test <img src=\"test.gif\"> importhtml</body></html>", "c:\\my picture", ImportHtmlBodyOptions.ImportLocalPictures | ImportHtmlBodyOptions.ImportCss);
Console.WriteLine("start to send email with embedded image ...");
oSmtp.SendMail(oServer, oMail);
Console.WriteLine("email was sent successfully!");
} catch (Exception ep) {
Console.WriteLine("failed to send email with the following error:");
Console.WriteLine(ep.Message);
If you have any other concern regarding this issue, please feel free to let me know.
Best regards,
Youjun Tang
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Burst in HTML format as body of email
Is this possible?
I have a very small report that I want to burst to email, but I want the email body to contain the HTML report. (In theory, so it can be read on mobile devices).
When I set attachment to false, the emails are blank.Not certain if you're using EBS but if you do,.. bursting email body can be html formatted like the control file excerpt below...
<xapi:message id="${TRX_NUMBER}" to="$[email protected]" cc="" bcc=""
attachment="true" content-type="text/html" subject="TEST ${TRX_NUMBER}">
<![CDATA[
<html>
<body>
<p>Dear Customer,<br/><br/></p>
<p>This is a test message.<br/><br/></p>
<p>This is another test message.<br/><br/></p>
<p>Thank you again.<br/><br/></p>
<p>IT Dept<br/></p>
</body>
</html>]]>
</xapi:message>regards,.. -
Formating body in email activity to HTML
Hi,
I am trying to create a table with dynamic values using email acitivity in BPEL. Iam using 11.1.1.6.0 with PS5.
Could anyone share the step by step sample process to achive HTML formatting in email, which can be used for the above use case?
Thanks,
Naveen KumartalariARe you using the Email service or using the Process Management email?
If you are using the Email service, in the Receive operation, there is a property called Body (HTML) that allows you to save the HTML code as a string value.
http://help.stage.adobe.com/en_US/enterpriseplatform/10.0/WorkbenchHelp/WS92d06802c76abadb -7744acc912826be985b-8000.html -
Email with html body and a pdf attachment
Hi,
i try to send a email with html body and one attach in pdf
in release 4.6c using the SO_DOCUMENT_SEND_API1.
I've put the html in the txt table and the pdf in bin table but i obtain the following situation:
1) with only the html in the body i see a right email in html
2) with the html body AND the pdf attach i obtain a empty mail with two attach.
what can i do ? I's possible to do this.
Thanks in advance.Contact my basis guy is a problem !!
maybe a need a function similar to SX_OBJECT_CONVERT_RAW_TXT to convert raw (containing html text) into real html ?
my view V_SXCONV contain:
ALI HTM 2 SX_OBJECT_CONVERT_ALI_HTM
ALI PS 4 SX_OBJECT_CONVERT_ALI_PRT
ALI RAW 1 SX_OBJECT_CONVERT_ALI_RAW
ALI TXT 2 SX_OBJECT_CONVERT_ALI_TXT
ICS RAW 8 SX_OBJECT_CONVERT_ICS_RAW
INT RAW 8 SX_OBJECT_CONVERT_INT_RAW
OBJ HTM 2 SX_OBJECT_CONVERT_OBJ_HTM
OTF PCL 3 SX_OBJECT_CONVERT_OTF_PRT
OTF PDF 1 SX_OBJECT_CONVERT_OTF_PDF
OTF PS 2 SX_OBJECT_CONVERT_OTF_PRT
OTF RAW 9 SX_OBJECT_CONVERT_OTF_RAW
RAW SCR 6 SX_OBJECT_CONVERT_RAW_SCR
RAW TXT 7 SX_OBJECT_CONVERT_RAW_TXT
SCR OTF 1 SX_OBJECT_CONVERT_SCR_OTF
TXT INT 7 SX_OBJECT_CONVERT_TXT_INT
URL HTM 2 SX_OBJECT_CONVERT_OBJL_HTM
thanks a lot. -
AppleScript: Add a HTML file in the body of Email by the clipboard
I would like to insert a HTML file into the body of Email by the clipboard action.
This is my cord below:
set the clipboard to (read (choose file) as «class RTF »)
set theBody to "Hello"
tell application "Mail"
activate
set theMessage to make new outgoing message with properties {content:theBody, visible:true, subject:"mysubject"}
end tell
tell application "System Events"
tell process "Mail"
set focused of UI element 1 of scroll area 1 of window 1 to true
keystroke "v" using command down
end tell
end tell
This code enables only rtf file rather than HTML.
Also I don't want to use the html content by the function of Mail.
Because if using it, you won't insert both a html file and body at the same time.
So what I would like to is to insert a HTML file by the clipboard action into a body.
Thank you!Hi,
One solution is to use Safari to copy the document:
set x to choose file -- a HTML file
tell application "Safari"
open x
delay 2
repeat while source of document 1 does not contain "</html>"
delay 1.5
end repeat
activate
end tell
tell application "System Events"
tell process "Safari"
set frontmost to true
keystroke "a" using command down -- select all
delay 0.3
keystroke "c" using command down -- copy to clipboard
end tell
end tell
set theBody to "Hello"
tell application "Mail"
activate
set theMessage to make new outgoing message with properties {content:theBody, visible:true, subject:"mysubject"}
end tell
tell application "System Events"
tell process "Mail"
set focused of UI element 1 of scroll area 1 of window 1 to true
keystroke "v" using command down
end tell
end tell
Also try this:
set the clipboard to (read (choose file) as «class HTML») -- a HTML file -
Sender Mail Adapter - html body mail
Hello Everybody,
I'm facing this strange problem:
I receive an e-mail with an XML attachment with a sender mail adapter and I use the PayloadSwapBean to let the attachment be the real payload as explaned in this blog
<a href="/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step:///people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
If I receive mail in text/plain format everything works fine, but as soon as I get an email with an html body (content-type: multipart/alternative; boundary=...) it doesn't any more (In the XI Monitor i still se 2 payloads, but I can only open the one with the attachment).
In this case the mapping is stuck in "scheduled for outbound process" status and the XI queue gets blocked with status "SYSFAIL" giving this error "Access via 'NULL' object reference not possible".
Is there any way to force XI digest also HTML e-mails?
As always, thanks a lot for your help.
DanieleThanks Akshay,
this really worked!
Fyi I'm using XIPAYLOAD option. I added in the module chain, before the PayloadSwapBean, a MessageTransformBean with this parameter:
Transform.ContentType - text/plain;charset=uft-8
this way I can also see the massage body in the monitornig.
Hope this will be helpful for someone else.
Regards,
Daniele -
Dunning letter (email) PDF attachment or body of email
Hi experts,
What is the industry practice for dunning letters when sent via email? Attach them as a pdf to the email, or add all the content of the dunning letter to the body of the email to make it easier for the customer to receive the message?
Thanks,
MarioHi Mario,
It all depends on the functionality that and payment option that are provided.
If the dunning letters contains and payment/remittance slip(through which customer can make payment in bank, outlet or post office) than the letter should go as PDF attached to mail with body saying that its the reminder for payment being missed,
But if the payment option is not like as described above than you can send the the letter in html body mail.
Regards -
Want to send a email with images and text in the body of email in iOS
In iOS, we have written a code to send an email, with embedded images and text in the body of the email ( not attachment) using mail composer. It works well with iOS devices like iPhone and iPad, but does not work in window based OS. Can anybody help. The code is
Thanks James !, do you have an idea how to find the window resource which I belive will be included in our appllication pack.
In above I have missed to copy the code,below is the code. This might help you to help me.
NSMutableString *imgContent = [[[NSMutableString alloc] initWithString:@"<html><body>"] retain];
UIImage *imageData = [UIImage imageNamed:@"Midhun.png"];
NSData *imageDataInBase64 = [NSData dataWithData:UIImagePNGRepresentation(imageData)];
NSString *base64String = [imageDataInBase64 base64EncodedString];
[imgContent appendString:[NSString stringWithFormat:@"<p><b><img src='data:image/png;base64,%@'></b></p>",base64String]];
[imgContent appendString:@"</body></html>"];
MFMailComposeViewController *emailWin = [[MFMailComposeViewController alloc] init];
[emailWin setMessageBody:imgContent isHTML:YES]; -
How to send a mail with HTML body from Oracle
Hi Team,
Can somebody guide me how to send a mail with HTML body from oracle.
Here is the piece of code i am trying to send a mail.
procedure SEND_MAIL is
cursor c_1 is select * from table_name;
l_mail_id varchar2(40);
-- ls_mailhost VARCHAR2(64) := Mailhost;
ls_from VARCHAR2(64) := ‘[email protected]’
ls_subject VARCHAR2(200);
ls_to VARCHAR2(64);
l_mail_conn UTL_SMTP.connection;
ls_left_menu_name VARCHAR2(64);
ll_emp_num number(8);
begin
for i in c_1 loop
begin
l_mail_conn := UTL_SMTP.OPEN_CONNECTION('IP');
UTL_SMTP.HELO(l_mail_conn, 'IP');
UTL_SMTP.MAIL(l_mail_conn, LS_FROM);
UTL_SMTP.RCPT(L_mail_conn, LS_TO);
UTL_SMTP.DATA(l_mail_conn,'From: ' ||ls_from || utl_tcp.crlf ||
'To: ' ||ls_to || utl_tcp.crlf ||
'Subject: ' ||ls_subject|| utl_tcp.crlf);
UTL_SMTP.QUIT(l_mail_conn);
exception
when no_data_found then
null;
when others then
RAISE_APPLICATION_ERROR(-20000, 'Failed to send mail due to the following error: ' || sqlerrm);
end;
end loop;
end;
ThnxHi Nicolas!
Have you tried to set "Output Format" for "RAW Text" to HTM in SCOT.
If HTM is missing in your dropdown-list, you could check out table SXCONVERT2. Copy the line with category T/format TXT, and change the format from TXT to HTM. The existing function
SX_OBJECT_CONVERT__T.TXT does not need to be changed. Now you should be able to choose HTM in SCOT. You will probably need som HTML-tags in your text to make it look good.
Hope this helps!
Regards
Geir -
Hello,
I am trying to send html in email but instead of html I just get plain text.
I am trying to send this string <html><body><p>Hello</p></body></html>I have tried to set content of the email to "text/html" as well as to "text/html; charset=\"ISO-8859-1\"".
I am viewing this email in Outlook 2007
Here is the method which sends the email.
public void sendMail(String fromEmail, String toEmail, String subject, String messageBody)
throws MessagingException {
Properties props = System.getProperties();
props.put("mail.smtp.host", host);
Session session = Session.getDefaultInstance(props, null);
MimeMessage message = new MimeMessage(session);
message.setContent(messageBody.toString(), "text/html");
// message.setContent(messageBody, "text/html; charset=\"ISO-8859-1\"");
message.setFrom(new InternetAddress(fromEmail));
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(toEmail));
message.setSubject(subject);
message.setText(messageBody);
Transport.send(message);
}bshannon wrote:Your setText call is overriding your setContent call.
Get rid of the setContent call and use
message.setText(messageBody, "iso-8859-1", "html");You were right my setContent call was overriden by setText. As soon as I moved it just before send call. It worked. The only question I have now why did you suggest to get rid off setContent and to use setText instead ? What's the difference ?
Thanks -
Mail with HTML BODY content?
Hi,
We seem to have a little problem with sending mails wtih HTML content, we have a "Link" in the mail body to be sent , so we are using html tags <a href=""link"></a> so that the mail receipient see the URL as a link ....
The actual code used is given below:-
l_body_html := ' <html>
<body>
<p>Hi,<br><br>You have been provided access to <a href="http://URL.com:20000/pls/htmldb/f?p=102"></a>'||
'</p> </body> </html>'
HTMLDB_MAIL.SEND(
P_TO => '[email protected]',
P_FROM => '[email protected]',
P_BODY => l_body_html,
P_BODY_HTML => l_body_html,
P_SUBJ => 'Access Details.');
What is wrong here , except the link of URL the rest of the text is coming in the mail body...
regards
NaveenNaveen,
This is an HTML problem. You have provided no text for the anchor.
You probably want something like:
<a href=http://URL.com:20000/pls/htmldb/f?p=102>Click Here</a>
And to be proper HTML, you should enclose the href value in double quotes, as in:
<a href="http://URL.com:20000/pls/htmldb/f?p=102">Click Here</a>
Joel -
Hello everybody,
I made a program to send by email an HTML file as attachment. All works fine except that the HTML file is not attach to the mail, instead of that the HTML code is inserted in the email body.
The same code works fine for XLS, PDF format, attachment is created, but not for HTM or TXT format.
I'm in 4.6C. I think the problem is coming from the configuration of SAPConnect.
Here is the routine code :
*& Form send_mail
* Send mail
* -->PT_HTML Attachment file containing HTML code
* -->PW_EMAIL Email address
* <--PW_RCODE Return code
FORM send_mail TABLES pt_html STRUCTURE w3html
USING pw_email
pw_obj_descr
CHANGING pw_rcode.
DATA : lt_file_att TYPE TABLE OF solisti1,
ls_file_att TYPE solisti1.
DATA : ls_document_data TYPE sodocchgi1,
l_cnt TYPE i.
DATA : lt_packing_list TYPE TABLE OF sopcklsti1,
ls_packing_list TYPE sopcklsti1,
lt_contents TYPE TABLE OF solisti1,
ls_contents TYPE solisti1,
lt_receivers TYPE TABLE OF somlreci1,
ls_receivers TYPE somlreci1,
lt_object_header TYPE TABLE OF solisti1,
ls_object_header TYPE solisti1.
DATA : lt_objtxt TYPE TABLE OF solisti1 WITH HEADER LINE,
l_lines TYPE i,
l_sender TYPE so_rec_ext.
CLEAR pw_rcode.
lt_file_att[] = pt_html[].
* Fill the document data and get size of attachment
CLEAR ls_document_data.
DESCRIBE TABLE lt_file_att LINES l_lines.
READ TABLE lt_file_att INTO ls_file_att INDEX l_lines.
ls_document_data-doc_size =
( l_lines - 1 ) * 255 + STRLEN( ls_file_att ).
ls_document_data-obj_langu = sy-langu.
ls_document_data-obj_name = 'Report to VMI'.
ls_document_data-obj_descr = pw_obj_descr.
ls_document_data-sensitivty = 'F'.
* Describe and create the body of the message
CLEAR ls_packing_list.
REFRESH lt_packing_list.
ls_packing_list-transf_bin = space.
ls_packing_list-head_start = 1.
ls_packing_list-head_num = 0.
ls_packing_list-body_start = 1.
ls_packing_list-body_num = 1.
ls_packing_list-doc_type = 'RAW'.
APPEND ls_packing_list TO lt_packing_list.
* Describe and create attachment
CLEAR ls_packing_list.
ls_packing_list-transf_bin = ' '.
ls_packing_list-head_start = 1.
ls_packing_list-head_num = 0.
ls_packing_list-body_start = 1.
DESCRIBE TABLE lt_file_att LINES ls_packing_list-body_num.
ls_packing_list-doc_type = 'HTM'.
ls_packing_list-obj_descr = 'TEST1'.
ls_packing_list-obj_name = 'TEST1'.
ls_packing_list-doc_size = ls_packing_list-body_num * 255.
APPEND ls_packing_list TO lt_packing_list.
* Add the recipient(s) email address
CLEAR ls_receivers.
REFRESH lt_receivers.
ls_receivers-receiver = pw_email.
ls_receivers-rec_type = 'U'.
ls_receivers-com_type = 'INT'.
ls_receivers-notif_del = 'X'.
ls_receivers-notif_ndel = 'X'.
APPEND ls_receivers TO lt_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = ls_document_data
put_in_outbox = 'X'
sender_address = l_sender
sender_address_type = 'INT'
TABLES
packing_list = lt_packing_list
contents_txt = lt_file_att
* contents_bin = lt_file_att
receivers = lt_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
pw_rcode = sy-subrc.
ENDFORM. " send_mail
Thank you in advance for your answer.hi,
pls use this demo code and reward points if it works -
REPORT ZGILL_SENDMAIL_PDF .
INCLUDE ZGILL_INCMAIL. "SEE BELOW FOR INCLUDE PROGRAM CODE.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case DEFAULT '[email protected]'.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY DEFAULT 'C:\TEMP\SALARY_SLIP1.PDF'.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
*********************iNCLUDE pROGRAM********************************************
*& Include ZGILL_INCMAIL *
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
**********************INCLUDE END******************************** -
Hi all,
I'm creating email-messages via ObjAPI in GW with a HTML-Body, which has to be done
by attaching a Text.htm to a message. This file has the desired Html-Body as content.
Besides that I define a BodyText as the plain text part of the message. That message
is saved as a draft and then sent by the ObjAPI command ".Send()".
In my Text.htm file I define UTF-8 as the charset of the html document, because I do
have to use special chars, like german Umlaute or something similar.
My html content comes from a "external" HTML editor.
When adding my "Text.htm" as attachment, GW seems to choose the charset for the
email-message itself by checking the BodyText content. So the effect when sending
such a message via GWIA is the following:
GWIA defines a "MIME-charset", i.e. "iso-8859-1", but my "Text.htm" has defined
"utf-8" as charset, so the reveiving email-client won't display the html-content
right; most speical chars are displayed as the all known "garbage".
If I open the created draft message inside the GW client and send it via the client
button "Send" the message will be sent correct; so I assume the whole "charset thing"
is handled by the client.
What options do I have to send HTML messages, containing special chars (german
umlaute) just by using the ObjAPI (without Tokens!)?
Any possibility to "force" GW to use a special charset when sending a message?
Environment: GW 7.0.3 (POA + client).
regards,
MarkusI created a bug to investigate the problem.
>>> On Monday, October 05, 2009 at 3:24 AM, Markus
Colorado<[email protected]>
wrote:
> Hi Michael,
>
> 1) UTF‑8 is definitely defined for the logged in user under tools >>
options >>
> send
>
> 2) The workaround via SMTP is not an option ‑ the customer wants the
sent
> messages in
> the "sent items" folder.
>
>>> I think it's not the GWIA but the Windows client..
> Well I assume the client doesn't do any work when creating the mail just
via
> ObjAPI;
> I personally think that goes 1:1 to the GWIA which creates the MIME and so
> does the
> charset‑handling.
> I can't image the client is involved cause "resending" such a message via
> client does
> bring up a completely different charset‑handling in the MIME! Those
messages
> are sent
> with correct encoding; UTF‑8 with the tested messages...
>
> Again my question: how can I force GW to use i.e. UTF‑8 encoding for the
> text/html
> part?
>
> Alternative way: if I could "get/read/guess" the information which
encoding
> will be
> used by GW for the text/plain part, I would even convert the text/html
part
> to that
> encoding, cause GW does set the text/plain and text/html part to the same
> encoding;
> no idea why....
>
>
> Markus
>
>
>
> "Michael Bell" <mikebell90@no‑mx.forums.novell.com> schrieb im
Newsbeitrag
> news:[email protected]. ..
>> Markus Colorado wrote:
>>> Hi Preston,
>>>
>>> we've tested with GW8 SP1 again now, but the problem still remains.
>>> It seems that the GWIA sets the charset for the text/html part to the
same
> value
>>> as the text/plain part, which causes these problems.
>>>
>>> I can't guess which charset the GWIA will choose so I've no chance to
> convert my
>>> TEXT.htm content...
>>>
>>> Any ideas how to solve that? ‑
>>> Can I define/force the charset handling via SOAP?
>>>
>>>
>>> Markus
>>>
>>
>> I think it's not the GWIA but the Windows client. See if you set it to
UTF‑8
> for
>> the user you are logging in if this fixes it.
>>
>> Of course it is still unacceptable, and still should be fixed in the
API.
>>
>> The other obvious workaround is to create an SMTP message and just mail
it
> that
>> way.
>>
>>>
>>>
>>> "Preston Stephenson" <[email protected]> schrieb im Newsbeitrag
>>> news:[email protected]...
>>>> You won't get any help in 7.0.x.
>>>> Have you tried 8.0.x?
>>>>
>>>>>>> On Monday, August 17, 2009 at 4:28 AM, Markus
Colorado<[email protected]>
>>>> wrote:
>>>>> Hi all,
>>>>>
>>>>> I'm creating email‑messages via ObjAPI in GW with a HTML‑Body,
which
>>>> has to be
>>>>> done
>>>>> by attaching a Text.htm to a message. This file has the desired
>>>> Html‑Body as
>>>>> content.
>>>>> Besides that I define a BodyText as the plain text part of the
message.
>>>> That
>>>>> message
>>>>> is saved as a draft and then sent by the ObjAPI command ".Send()".
>>>>>
>>>>> In my Text.htm file I define UTF‑8 as the charset of the html
document,
>>>>> because I do
>>>>> have to use special chars, like german Umlaute or something similar.
>>>>> My html content comes from a "external" HTML editor.
>>>>>
>>>>> When adding my "Text.htm" as attachment, GW seems to choose the
charset
>>>> for
>>>>> the
>>>>> email‑message itself by checking the BodyText content. So the
effect
>>>> when
>>>>> sending
>>>>> such a message via GWIA is the following:
>>>>> GWIA defines a "MIME‑charset", i.e. "iso‑8859‑1", but my
"Text.htm"
>>>> has defined
>>>>> "utf‑8" as charset, so the reveiving email‑client won't display
the
>>>>> html‑content
>>>>> right; most speical chars are displayed as the all known "garbage".
>>>>>
>>>>> If I open the created draft message inside the GW client and send it
via
>>>> the
>>>>> client
>>>>> button "Send" the message will be sent correct; so I assume the whole
>>>>> "charset thing"
>>>>> is handled by the client.
>>>>>
>>>>> What options do I have to send HTML messages, containing special
chars
>>>>> (german
>>>>> umlaute) just by using the ObjAPI (without Tokens!)?
>>>>> Any possibility to "force" GW to use a special charset when sending a
>>>>> message?
>>>>>
>>>>> Environment: GW 7.0.3 (POA + client).
>>>>>
>>>>>
>>>>> regards,
>>>>> Markus
>>> -
i cant see the body of emails received...
I had this exact issue the other day, come to find out it was a html email and the background color was red but outlook doesn't print the background, the user replied to the email and changed the font color to white because of the background color but
when printing it was white on white.
Maybe you are looking for
-
Planned Order Release from SNP to R/3
Hello All - We are facing a situation where in we just want to release only a certain number of planned orders that are there in a particular horizon... Now i am not sure as to can we or we cannot do that? can anyone please confirm and explain as to
-
How do I copy a photo I received in an e-mail to iPhoto?
How do I copy a photo I received in an e-mail to iPhoto?
-
Transfering Library from Mac to PC
I recently purchased a new Compaq and want to transfer my libray from an iBook G4 How can I do this??
-
Match will not upload tracks no longer available in the Store?
I purchased and album on 2/4/2007 (see below) which is apparently no longer available in the iTunes store. I understand that some music that was once available might be removed from the store for copyright reasons. Because these tracks were protecte
-
I'm using Oracle BI Publisher 11.1.1.3.0 and I've created a Dataset with several parameters. (6 to be precise) I'm using the "Get XML Output" button to generate my sample data... Without the parameters all is good... but when I add parameters... the