예제 #1
0
    // Use this for initialization
    void Start()
    {
        // create some arbitary binary data. or load from existing location
        FileStream someFile = new FileStream(Application.temporaryCachePath + "/someFile.bin", FileMode.Create);

        someFile.WriteByte(0x42);
        someFile.Close();

        _mailController = new MFMailComposeViewController();

        _mailControllerDelegate             = new MyMFMailComposeViewControllerDelegate();
        _mailController.mailComposeDelegate = _mailControllerDelegate;

        _mailController.SetToRecipients(new string[] { "*****@*****.**" });
        _mailController.SetSubject("well hello");
        _mailController.SetMessageBody("just testing attachments", false);

        _mailController.AddAttachmentData(
            new NSData(Application.temporaryCachePath + "/someFile.bin"),
            "application/octet-stream",
            "someFile.bin"
            );

        UIApplication.deviceRootViewController.PresentViewController(_mailController, true, null);
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        // create some arbitary binary data. or load from existing location
        FileStream someFile = new FileStream(Application.temporaryCachePath+"/someFile.bin", FileMode.Create);
        someFile.WriteByte(0x42);
        someFile.Close();

        _mailController = new MFMailComposeViewController();

        _mailControllerDelegate = new MyMFMailComposeViewControllerDelegate();
        _mailController.mailComposeDelegate = _mailControllerDelegate;

        _mailController.SetToRecipients(new string[]{"*****@*****.**"});
        _mailController.SetSubject("well hello");
        _mailController.SetMessageBody("just testing attachments", false);

        _mailController.AddAttachmentData(
            new NSData(Application.temporaryCachePath+"/someFile.bin"),
            "application/octet-stream",
            "someFile.bin"
        );

        UIApplication.deviceRootViewController.PresentViewController(_mailController, true, null);
    }