How to programmatically send emails using object C / cocoa

Hi, I'm new to MAC OS development, and I want to send an email programmatically through the application, but without using the Mail application, for example, in SBSendEmail from the apple website. I don't want to attach any attachments, just a text email. What is the best and easiest way to do this? Is it possible to use the basic functionality from SBSendEmail and automate the last step of sending mail through the MAIL application? Is there a simple way, as in C #, to create a mail object and just send it? Thank.

+3
source share
2 answers

There is no way to do this in pure Cocoa, except using one of the three or four email libraries available (Pantomime is the one I know from my head). The main problem is that they are designed to implement a full email client, and not just send emails, so they are probably heavier than you need.

To display Growl MailMe, I wrote a command-line mail sending tool in Python . The Xcode project associates this with the MailMe plug-in package, and MailMe launches this tool using NSTask, passing the SMTP information that it finds in the Mail user settings. Growl is also open source, so you can read the source for displaying MailMe .

Things that won't work:

  • , API 64- .
  • mail (1), , SMTP- ( SMTP-, ).

, MailMe , MobileMe, MobileMe. , , !

, MailMe Mail . , , . -, Thunderbird, , , .

+2

/usr/lib/sendmail, . /usr/lib/sendmail stdin. .

0

Source: https://habr.com/ru/post/1758810/


All Articles