How to get the no of attachments in an email using objective-c? - iphone

Hi am new to xcode programing,i am trying an app regarding the email attachments to show the no of attachments an email contains,i got the single attachment showing but i need how n=many are there in particular email,if any body knows about this please help me.Here is the code regarding the app:

From looking solely at the code you have provided, it would appear that all you need is [attachments count] to provide the number of attachments in the current message

Related

PowerAutomate - create workitem when email is received and attach the email

I am able to open a new work item every time I receive an email with specific words in the subject.
I want to add the email itself to the work item as attachment. I have no clue how to do that.
The flow looks like this one (I cannot expand for privacy):
Any suggestion?
P.S. I searched online before posting this question but no result was promising....

How I can send a email with attachments in Camunda?

I am new here and also using the Camunda application, my question is that when I try to send an email with Camunda's own extension ( camunda-bpm-mail ) I don't see that I have the option to send attachments along with the email and I would like to know if there is a way to do it. Thank you.
The camunda-bpm-mail component supports attachments. See:
https://github.com/camunda-community-hub/camunda-platform-7-mail/blob/6470b1351818d90b61d941fe05b1205e14a637a4/extension/core/src/main/java/org/camunda/bpm/extension/mail/send/SendMailRequest.java#L40
https://github.com/camunda-community-hub/camunda-platform-7-mail/blob/6470b1351818d90b61d941fe05b1205e14a637a4/extension/core/src/main/java/org/camunda/bpm/extension/mail/send/SendMailConnector.java#L121
and includes an example;
https://github.com/camunda-community-hub/camunda-platform-7-mail/tree/main/examples/print-service/src/main/resources

Swift 4, CorePlot, send chart via mail app (with MessageUI)

Can I somehow take the chart (which was made with CorePlot) from view and send it as a file to another person via mail app? I want to send mail with the help of MessageUI. I feel fine if just the picture will be sent.
Use the -imageOfLayer method to get a PNG of the graph or the -dataForPDFRepresentationOfLayer method to get a PDF and attach the resulting file to a message.

How to retrieve the .xml extension attachments from mail by using MailCore to Sample iPhone app

How to retrieve the .xml extension attachments from mail by using MailCore for iphone?
I used MailCore to download the attachments from my mail to my sample iPhone app. I getting Inbox subjects from my mail that subjects I sort to get particular mail subject and mail attachments.
The problem is I got particular mail subject but not attachments. I used below code to get attachments from mail but it's not working.
NSArray *Array=[msg attachments];
CTBareAttachment *ctbaratt=[Array objectAtIndex:0];
CTCoreAttachment *ctcoreatt=[ctbaratt fetchFullAttachment];
but I'm getting :
Array count is zero
Please share your ideas.
This could be for a few reasons:
1)It is possible that you're not downloading enough information about the CTCoreMessage. When making a request to download the CTCoreMessages you must specify what information you want by specifying the correct fetch attributes.
For example:
[core_folder messagesFromSequenceNumber:from to:to withFetchAttributes: CTFetchAttrEnvelope | CTFetchAttrBodyStructure]
should populate the information about the attachments.
When fetching a message from IMAP, the command will specify exactly what information it wants.
you can see what is being fetched by enabling MailCore Logging as follows:
MailcoreEnableLogging();
[core_folder messagesFromSequenceNumber:from to:to withFetchAttributes: CTFetchAttrEnvelope | CTFetchAttrBodyStructure];
MailcoreDisableLogging();
You will see commands of the format
<command number> <UID> <Command> (<requested structure>)
I imagine you will see something like this:
1 UID FETCH (ENVELOPE)
You should ensure that inside the () either BODY or BODY[2] or RFC822 as these will contain information about attachments.
When you see what is actually being fetched you can read the RFC, if you are dealing with mailcore and IMAP then it is well worth the investment in time.
2)Failing that, perhaps your CTCoreAccount and/or CTCoreFolder are not connected, thus preventing the CTCoreMessage from having a valid mailimapsession and being unable to download the attachment information. If an attribute inside a CTCoreMessage is not available then libetpan should download it on request. The fact that is it not suggests that your account or folder may be not valid or connected.

load magento email template

I'm using my own code to send out SMS's to the customers at the same time as the emails go out. I do this by getting the email template code with
$code = $this->getTemplateCode();
and then trying to load the corresponding SMS template with
$sms = $this->loadByCode('sms_'.$code)->getTemplateText();
I then check if $sms is empty before proceeding to send the text, meaning that I can add or remove connected SMS templates at will. The problem I'm having is that I sometimes, when there is no connected "sms_*" template, I get the full email sent out as the SMS instead of no text being sent.
I've debugged the code by sending out the template it tries to load as the actual SMS, and received "sms_creditmemo", but when I instead load it with the method above and do a var_dump($sms); exit;it shows me that it loaded the template "creditmemo_invoice" which is the email template I use instead of "creditmemo" when the payment method is detected. I make sure to use the original template string in $code (used to load SMS template) no matter the payment method.
Now my question would be how this can even be possible, does the loadByCode take best matching template or is there some other more serious bug I've missed, maybe there's better ways to load in the templates and make correct checks to see if they even exist?
I solved this by checking if the correct email template gets loaded with
if ($this->loadByCode($template)->getTemplateCode() == $template)