Computer Science, asked by nisreensabir5661, 1 year ago

How to send an attachment in email using Swift?

Answers

Answered by rishu4653
0

Hey mate!!!!

Here is your answer....

Steps to send email with attachment in swift:

Step 1: Create a single view application template project in xcode and name it "SendMailAttachment"

Step 2: Open "Main,storyboard" file and first change background color for the view and drag a UIButton on to the view. Set title for the button "Send Email". Set the font and color as per your requirement or how you like it would appear in your app.

Step 3: Open "ViewController.swift" and create an IBAction for the button we created in step 2.

Step 4: Open "Main,storyboard" file and connect IBAction created in step 3 to "touchUpInside" event of UIButton.

Step 5: Now, as we set up our UI and now it's time to do some coding. So open "ViewController.swift". In order to send email first we need to import MessageUI framework.

Step 6: Inside the IBAction, paste code.

hope it helps...

plz mark it as brainiest

Similar questions