• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: sending mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sending mail


  • Subject: Re: sending mail
  • From: Robert Cerny <email@hidden>
  • Date: Wed, 17 Dec 2003 19:51:20 +0100

Hi,
simple mail sending using pantomime:

ToRecipient *toAddress = [[ToRecipient alloc]
initWithString:myAddress];
NSString *emailContents;
InternetAddress *fromAddress = [[InternetAddress alloc]
initWithString:myAddress];

Message *messageObj = [[Message alloc] init];
SMTP *smtpObj = [[SMTP alloc] initWithName:mailHost
port:25];

[smtpObj authenticateWithUsername:authName
password:nil
mechanism:nil];
emailContents = [NSString stringWithFormat:@:"%@",
@"dajdajhdjajsdjad"];

[messageObj setContentType:@"TEXT/PLAIN"];
[messageObj setCharset:@"CHARSET=utf-8"];
[messageObj addToRecipients:toAddress];
[messageObj setFrom:fromAddress];
[messageObj setSubject:@"Some subject";
[messageObj setContentFromRawSource:[emailContents
dataUsingEncoding:NSUTF8StringEncoding]];

[smtpObj sendMessageFromRawSource:[messageObj dataValue]];

[smtpObj release];
[toAddress release];
[messageObj release];


HTH
Robert


On 17.12.2003, at 18:56, Matt Gillette wrote:

> I've been looking at the NSMailDelivery class, but I'd like to ask some
> questions to the list before I use them:
>
> Is there a way to choose which account is being used, or at least get
> some of the details so the user can be shown which account will be
> used?
>
> In the archives someone mentioned that it didn't work with servers
> requiring authentication - is this still the case? I can't test since I
> don't have an authentication only server.
>
> Also, there a bug with the hasDeliveryClassBeenConfigured method.
> Whenever I use it it returns false, but if I just send the message it
> succedes - also if I call hasDeliveryClassBeenConfigured and then try
> to send a message it fails - (this may be related to modal dialog -
> JOAR mentions the same problem in the archives).
>
> Also on the topic, I downloaded Pantomime (a free framework) but
> couldn't find any documentation. Does anyone know of some links to its
> documentation? I'm a little reluctant to look at GNU Mail source since
> all I want is to send a message.
>
>
> On Dec 16, 2003, at 2:00 PM, Tim Hewett wrote:
>
>> Check out the NSMailDelivery class (seems to be undocumented).
>> You will have to craft your own composer window but that should
>> be relatively simple. Then this class will send the mail for you.
>>
>> Regards,
>>
>> Tim.
>>
>>
>> On 16 Dec 2003, at 19:56, email@hidden wrote:
>>
>>> I'd like to allow the user of my app to send a block of text to
>>> someone. Ideally, the Mail app would automatically be launched
>>> and they'd find a normal "New Message" window with an empty To
>>> line and a block of text already entered for them.
>>>
>>> I thought that MacOS Services would be the answer. It's rather
>>> simple to make a pasteboard and hand that off to the Mail service
>>> for delivery. However, this seems to function in a really odd
>>> way. The Mail app does not open a "New Message" window. Instead,
>>> it creates a letter (after waiting 15-20 seconds) in the Drafts
>>> folder that the user has to notice and then click to edit. This
>>> hardly seems reasonable. Your average user is going to to wonder
>>> why Mail was launched but no message appears.
>>>
>>> Am I doing something wrong here? Is this really the expected
>>> behavior? Is there another way to get the effect I want? Any
>>> tips would be appreciated...
>>>
>>> Devon
>> _______________________________________________
>> cocoa-dev mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>> Do not post admin requests to the list. They will be ignored.
> _______________________________________________
> cocoa-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: sending mail (From: Tim Hewett <email@hidden>)
 >Re: sending mail (From: Matt Gillette <email@hidden>)

  • Prev by Date: Re: CoreFoundation on Win32
  • Next by Date: Re: Developing for 10.3
  • Previous by thread: Re: sending mail
  • Next by thread: Re: sending mail
  • Index(es):
    • Date
    • Thread