I want to receive a message body text in plain text format.
I am using the following code but when I am trying to get through extended property collection it gives nothing.
extendedPropertyDefinition = new ExtendedPropertyDefinition(0X1000,
MapiPropertyType.String);
propertySet = new PropertySet(PropertySet.FirstClassProperties.getBasePropertySet(),
ItemSchema.MimeContent, extendedPropertyDefinition);
propertySet.setRequestedBodyType(BodyType.HTML);
emailMessage = EmailMessage.bind(service, itemId, propertySet);
If you want the Plain body text then just make
propertySet.setRequestedBodyType(BodyType.HTML);
like
propertySet.setRequestedBodyType(BodyType.Text);
You can't request Both body types in the same request EWS will only even deliver one back to you. If you want both in the same request you can try to parse it out of the MimeContent but whether you will get both here will depend on the original format of the message. A lot of the times when ask for the Text body the Exchange Store does an one the fly conversion from whatever native format the message was sent in.
Related
When working with XML responses I dont have the option to Copy as Response body dynamic value?
Is this facility only available with JSON?
UPDATE-1:
Can't seem to get it working
I can add the Request object but the Key Path (dotted xpath) to the desired data is not giving the expected results. I am using "plan.link"
So the xml is like this
<plan>
<id>7286</id>
<piuid>1</piuid>
<title>Bollard Positions</title>
<link>http://<my-server-name>/port/1/plan/7286.gif</link>
</plan>
And I want to pick the url from the link element (plan.link)
But Paw is not reading right and changes the request to
GET / HTTP/1.1
Host: echo.paw.cloud
Connection: close
User-Agent: Paw/3.1.3 (Macintosh; OS X/10.11.6) GCDHTTPRequest
I'm doing something wrong but not sure what.
Any suggestions?
That's true, sadly you cannot just right-click and pick Copy as Response Body Dynamic Value for XML responses (only works for JSON and Form URL-Encoded).
Though, you can manually set a dynamic value to point to this field.
Right-click on a field where you want to insert this reference, and choose Response > Response Parsed Body
Enter the Key Path to the node you want to select, and end it with the text key to access the string's value.
Should be a working reference. You can have the preview below.
I am trying to create a SearchFolder using the EWS API (managed or web service directly). I noticed that I if I create a SearchFilter.ContainsSubstring on the ItemSchema.Body, I do not get any conversations from it.
here is how I create my folder:
var folder = new SearchFolder(service)
{
DisplayName = topic
};
var searchParameters = folder.SearchParameters;
searchParameters.SearchFilter = new SearchFilter.ContainsSubstring(ItemSchema.Body, topic, ContainmentMode.Substring, ComparisonMode.IgnoreCaseAndNonSpacingCharacters);
searchParameters.RootFolderIds.Add(WellKnownFolderName.Root);
searchParameters.Traversal = SearchFolderTraversal.Deep;
folder.Save(WellKnownFolderName.SearchFolders);
Later, I try to get the conversations from this folder:
service.FindConversation(conversationView, folder.Id);
And this returns 0 conversations.
I made sure by sending two messages to my email account, the first with a special term only in the subject, and the second with the same term in the body. If I create a SearchFolder with a filter on the ItemSchema.Subject, I get the first conversation, but using the SearchFolder I created above, I do not get the expected result.
Are there some restrictions regarding the ContainsSubstring SearchFilter? I tried using NormalizedBody or TextBody, but then I got errors in the folder creation process. Is there anything else I am missing?
Doing a search filter on the body will likely be problematic. This goes back to how potentially large properties like Body are handled in contents tables. A query string search would likely work better, but you can't use a query string to create a search folder.
I have 2 data sets:
Email as in excel attachment -- Detail
Summary as HTML in Body of the email -- Summary count of the 1st result set
How can we do this in SSRS? Currently I am using the 2 result sets in one excel and in 1 Email. But I want send the email as Summary Dataset 2 redult in Body of the Email and result set 1 as Excel attachment.
You're going to have to write some code for this I think as I don't think the SSRS scheduler is flexible enough to do what you want. I don't use the scheduler, I wrote a program that works fairly much how you describe here.
First up, you want to create a HTML email:
MailMessage message = new MailMessage("me#mycompany.com", "you#mycompany.com");
message.Subject = "Here is your report!";
message.IsBodyHtml = true;
Now, for the body of the email you need to run the report using the ReportExecutionService.Render method. First run the summary report rendered as HTML and make that the message body of the email.
message.Body = SummaryReport; // SummaryReport being the HTML report rendered above
Next, use the ReportExecutionService.Render method to render the detail report as Excel and add this as an attachment to your email:
ms.Seek(0, SeekOrigin.Begin); // ms is the MemoryStream that the report rendered to
message.Attachments.Add(new Attachment(ms, filename)); // filename is the name you want the attachment to have in the email
Then send and you're done!
SmtpClient smtp = new SmtpClient("smtpserver.mycompany.com");
smtp.Send(message);
The bit I haven't tried is using the HTML output of the summary report as the body of the email but it should work. What I do is run the Sql to return the summary and simply manually format that as HTML to create the email body.
Is there a way to use the django-contact-form to send a html email?
I just looked up the source and it's not built in.
You can certainly modify it however you please -- it's a very simple form and very readable.
You'd need to add a html_template variable/path and modify the save line, and add a way to specify which template to use.
def save(self, fail_silently=False):
"""
Build and send the email message.
"""
data = self.get_message_dict()
msg = EmailMultiAlternatives(subject=data['subject'], body=data['message'], from_email=data['from_email'], to=data['recipient_list'])
msg.attach_alternative(loader.render_to_string('path_to_my_html_template.html', self.get_context()), "text/html")
msg.send(fail_silently=fail_silently)
This is just easier to keep all of your changes in one spot.
Otherwise, you could re-write most of the code and change the method names and the strings in get_message_dict() to reflect the new field names for EmailMessage
Frankly, i'm not sure why send_mail should have different keywords than EmailMessage
I have a text field that I'd like to support an arbitrary amount of text in. Right now the text is sent through an XML object request using GET. I'd like to use POST to send the data back to the server. Are there any good options in ActionScript 1?
You want to use the LoadVars object and assign values to keys you create as you go so:
obj.id=myId;
obj.status = myStatusId;
obj.sendAndLoad(url, responseVarThatYouSetupToHandleOnLoadEvent, "POST");