Guest User

Untitled

a guest
Nov 19th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. CTCoreMessage *msg = [[CTCoreMessage alloc] init];
  2. CTCoreAddress *from = [[CTCoreAddress alloc] initWithName:@"Hardik Ruparel" email:@"hardik988@gmail.com"];
  3.  
  4.  
  5. [msg setTo:[NSSet setWithObject:from]];
  6. [msg setFrom:[NSSet setWithObject:from]];
  7. NSLog(@"%@",[NSSet setWithObject:@"hardik988@gmail.com"]);
  8. [msg setBody:@"Testing Body"];
  9. [msg setSubject:@"dshjksdsd"];
  10.  
  11.  
  12. CTCoreAttachment *attachment = [CTCoreAttachment alloc];
  13. [attachment initWithContentsOfFile:@"/Users/hr/test.txt"];
  14.  
  15. [msg addAttachment:attachment];
  16. [CTSMTPConnection sendMessage:msg server:@"smtp.gmail.com" username:@"##@gmail.com"
  17. password:@"###" port:587 useTLS:YES useAuth:YES];
Add Comment
Please, Sign In to add comment