Created
September 14, 2012 20:29
-
-
Save jenslukowski/3724559 to your computer and use it in GitHub Desktop.
RubyMotion: MailCore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
msg = CTCoreMessage.alloc.init | |
msg.setTo(NSSet.setWithObject(CTCoreAddress.addressWithName("Someone", email:"[email protected]"))) | |
msg.setFrom(NSSet.setWithObject(CTCoreAddress.addressWithName("Watson", email:"[email protected]"))) | |
msg.setBody("This is a test message!") | |
msg.setSubject("This is a subject") | |
error = Pointer.new(:id) | |
ret = CTSMTPConnection.sendMessage(msg, | |
server:"smtp.gmail.com", | |
username:"[email protected]", | |
password:"xxxxxxxx", | |
port:587, | |
useTLS:true, | |
useAuth:true, | |
error:error) | |
true | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
$:.unshift("/Library/RubyMotion/lib") | |
require 'motion/project' | |
Motion::Project::App.setup do |app| | |
# Use `rake config' to see complete project settings. | |
app.name = 'HelloMailCore' | |
# Configure MailCore | |
app.vendor_project('vendor/MailCore', | |
:xcode, :scheme => "MailCore iOS", :headers_dir => '.') | |
app.frameworks << "CFNetwork" | |
app.libs << "/usr/lib/libssl.dylib" | |
app.libs << "/usr/lib/libiconv.dylib" | |
app.libs << "/usr/lib/libsasl2.dylib" | |
app.libs << "/usr/lib/libcrypto.dylib" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@aceofspades That's because it's linking to static libraries on the Mac, and not the platform specific ones created by the Xcode build.
Took me a while to figure out the correct configuration, but eventually got it working:
https://gist.github.com/4425691