How to send a e-mail with html content and inline images using lotusscript agent?
GMail removes the inline images to file attachments.
IS it possible to prevent this?
Modification as requested in comments:
I have created a document to be used as mail template. This can be a normal memo in your mail file. In the body I added an image, like company logo, and some text. This memo is sent with lotusscript insted of manual sending button.
The lotusscript agent first remove the body and copy its content to a temporary rtitem. The text is replaced with merge field values. Then a new rich text item is created with the replaced text. The result of the text processing is a removed inline image in gmail.
Hope this information is enough, and this is the reason I think the code is not interesting here.
"MIME HTML inline"
look here http://www-10.lotus.com/ldd/nd6forum.nsf/0/c570f4a6e09a0d7585257333005217e9?OpenDocument
on gmail works.
all best
Related
My web application sends emails to subscribed users.
The email is formatted as an html page and contains html addresses specified as plain text (not inside href tag).
The intent is for the email client to display the html address as simple text, one that the user can "paint" with the cursor and copy to clipboard
This works just fine in some email clients (for example yahoo). However,
other clients (for example, MS outlook and gmail) detect these pieces of text, and display the html address as a link, making it difficult for the user to do the paint-copy-paste described above.
I tried the following:
wrap the text in CDATA block - gmail then disregards the whole block
escape the html address (instead of http://... --> http://...) - makes no difference (still make a link out of text)
any ideas?
you could but a double :: to disable the parsing:
http:<span style="display: none;">:</span>//google.com/
This will not show the second : and should avoid the parsing.
EDIT:
This will work:
http<span>:</span>//google<span>.</span>com/
I have a form with a text field that users input text into. They can use multiple lines, put in bold text, underlined text, etc., but the text, when saved to SQL Server doesn't have any formatting saved, just the text is saved. What is the best way to save the text with the HTML so that when it gets viewed by another user and pulled up from Sql Server the HTML is saved and the formatting is saved?
Ex.
hello
Paul
This would be saved as
helloPaul
you can't see it but there are bold and carriage return html tags rapped around the text
When receiving data from the user, on the server side code, use HTML encode to safely store the data:
var inputData = Server.HtmlEncode("<strong>some data input from user</strong>"); //insert your user input data variable here
Then when displaying the data in your cshtml page, decode the data to display it as the user entered it:
HttpUtility.HtmlDecode(saveUserDataFromDatabaseVariable);
All this is assuming you have a rich text editor being plugged into the input field. CKEditor and TinyMCE are good ones.
You can use a text editor. Take a look at CKEditor. It's free and easy to use :)
Can you post some code and more details?
I have had good success with CKEditor. It is customizable, and its content can easily be saved via postback to a standard asp:TextBox.
It is possible that the editor you are using is not actually updating the input/textarea that you are using, it may be cloning the text and drawing the formatting in an overlay. You can use developer tools, or javascript, to verify this by checking the value property of the input or textarea element. If it is being saved via AJAX or javascript the code may be using the textContent or innerText properties instead of innerHTML.
I used the richtexteditor dll that's free online. it gave me a wiziwig box that the user can edit texxt in.
I need to hide a 30 character string inside the HTML of an e-mail so when a user replies, their reply can be linked on our server to that 30 character string. We don't want to add the string to the subject or body of the e-mail where it's visible to the user. We also don't want to hide the text which would result in accidental selecting of the 30 character string.
The problem:
Many e-mail clients (like gmail) reduce HTML e-mail content to just the basic tags, making it difficult to find a tag that can hold an arbitrary string. This means we can't create an arbitrary tag, only use standard tags.
Our best solution:
Hide the string in the "title" tag of a table in the e-mail, like this -
<table title="30_character_string">
The solution above works in most cases. Most e-mail clients don't strip out the title tag, making it a viable option.
Why we're stuck: This isn't the best solution because sometimes e-mail clients get very restrictive and eliminate even the title attribute.
Can you help? What is the most successful way to hide an arbitrary string in the body of an HTML e-mail? Is there a better solution for this sort of linking?
If you put the value in markup, plain text replies won't work. Consider a "smallprint" section on the bottom of your email below your signature.
Dear User,
Email content
Regards,
Logo and such
ReplyIdentifer-xxxxxxxx.
If you don't care for that, add a div to the bottom of the email (again below the sig). ANd again, it will be on the bottom of the email where the user will rarely even care to look.
<style>.hide{display:none;}</style>
<div style="display:none" class="hide">ReplyIdentifer-xxxxxxxx.</div>
In this case, you only see it if the email client removes css AND style tags.
Checking some HTML emails I've received & Gmail seems to allow a <head> tag within the e-mail HTML. You could include the info in a <meta> tag within the head of the email.
What type of account are you reading mail in to? If it's also Gmail, you could make use of their ability to allow abritary strings in your emails address after a plus symbol. Override the reply-to header that you set on your out-going mail to youraddress+uniqueID#gmail.com
EDIT: Staying along the lines of e-mail headers though (which feels like it should be the right way to do this), if you make sure to generate a unique Message ID header for each copy of the mail going out, the In-Reply-To header that you get back should be unique to that recipient and that message. Gmail respects the Message ID header & provides the appropriate reply header in response, as should most (all?) mainstream clients/services
So let's say that there is a HTML (or XHTML) code and
<img alt="...." src=".......aspx" />:
So, aspx generates image file, and there will be some image shown.
Now I want to send the generated image file to E-mail or using HTML form code, and I want my html code to do this automatically.
So, in the html code, after img code, I'd like to add codes that send the generated image automatically.
(I want a single code with img code and E-mail or HTML form code.)
What should I do?
To be honest, based on your question, it's not entirely clear what you're trying to accomplish. But, from what I gather, you could try several different approaches:
Check out this StackOverflow post: Sending an email with an image embedded in the body from C#
You can use the code from this source as a starting point: http://www.codedigest.com/Articles/ASPNET/95_Sending_Email_using_C__and_ASPNet_20.aspx (see "Sending Email with Embedded Image in the Message Body" section)
What you need to do is move the image generation logic to some library or the App_Code folder, and then call that logic twice: once from the .aspx handler that sends it for the tag, and once for the code that you also need to write that will send it in the email. Once you have the byte[] array with the image, follow lkaradashkov's link to send it in the email:
Sending an email with an image embedded in the body from C#
I would like to send an html email with a link but want it to look ok if html is off in the recipients email client how can I do this:
With HTML:
Available Here
With Out HTML:
Available at https://stackoverflow.com/
Then use multipart alternative to send a text version alternative to your HTML email that has the full link.
You should ensure that your text is readable without css or html formatting (i.e. if you're using tables, make sure the order of the text is ok if you strip the tags, if you use images, use alts)
Use a library such as SwiftMailer that will let you add multipart content to an email. It's much easier than setting the headers yourself.