No HardCoded "fromEmail" (Sender) in SKPSMTPMessage

220 Views Asked by At

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 = @"[email protected]";

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.

1

There are 1 best solutions below

5
On

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.