2

I have been trying to use SKPSMTPMessage library.Although i have not yet succeeded would anyone let me know how i do not require to hardcode the sender of the mail. What i have seen is we need to hardcode the sender in order to send the mail in SKPSMTPMessage. something like this :

    SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
    testMsg.fromEmail = @"youremail@email.com";

But i don't want a particular sender rather it should be the sender from the device. Similar to one we have in mfmessagecomposeviewcontroller.

Also can i have the sender included in "CC/BCC" portion so as the sender as well receive's the copy of the mail he/she has sent.

Thank You.

ChikabuZ
  • 10,031
  • 5
  • 63
  • 86
iCodeAtApple
  • 466
  • 5
  • 16

1 Answers1

0

You can achieve this, here are the base-steps:

 - Create a screen/view which will collect all these informations (FromEmail, ToEmail, CC, BCC, SMTP Address, etc.) 

 - Save those details in your code.

 - Use those details while sending out mail.

Hence it will make your code look like:

  SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
  testMsg.fromEmail = fromEmailTextField.text;

Hope this helps.

Mrunal
  • 13,982
  • 6
  • 52
  • 96
  • That was a beautiful Pseudocode. But it would be great if you give me some real time code to grab the sender and to include him in CC/BCC, off course using SKPSMTPMessage. – iCodeAtApple Oct 03 '13 at 07:33
  • Just create a screen with several textboxes, like in question you're assinging from Email hard-coded. Instead of that you will require to do: testMsg.fromEmail = fromEmailTextField.text; Same way for the other properties. Even you can store all these values in strings, for future uses. – Mrunal Oct 03 '13 at 07:36
  • Yeah !! but then i don't want the user to fill in any kind of details.He would just click a button and a mail with an image as attachment would be sent to the receiver we've specified but the sender would come from the device the mail is being sent. – iCodeAtApple Oct 03 '13 at 07:40
  • For Eg: If i want to send the mail from my device i would have my mail already configured to the device so when i click sendButton the mail should be sent to the recipient with my mailAddress. – iCodeAtApple Oct 03 '13 at 07:41
  • @iCodeAtApple That's not possible. – JustSid Oct 03 '13 at 08:04