dear all

The issue has now been solved so here is the solution for all those that are interested:
You need to make your  URL request pointing to your php script:
and through my frustration I had forgotten to add the call to get URL request sent out with URLConnection
so here it is in full

The script sendInfo.php:

<?php
  $message = $_REQUEST['message'] ;

  mail( "t...@qu-s.eu", "Test Message", $message );
?>

and here is the code section in my cocoa app:

-( IBAction )   sendMail:( id )sender
{
        NSString *post = @"message=testing";
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
        
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
        
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:@"http://www.qu-s.eu/ sendInfo.php"]];
        [request setHTTPMethod:@"POST"];
        [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
        [request setHTTPBody:postData];
        [ NSURLConnection connectionWithRequest:request delegate:self ];
}

Thanks again to all and may I again refer interested people to this blog which has more information

http://deusty.blogspot.com/search/label/NSURLRequest

Reza






_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to