Programmatically send an email in iOS?

Does the Indy component idSMTP work under iOS? I am trying to develop an iOS app that will periodically send an email as a notification of something. I'd like to also be able to send a text message, separately. But first things first: I've tried to populate the idSMTP properties and it compiles and deploys to my iPhone just find, but when I call the method to send the email, the app just hangs. I have to wonder if idSMTP and the rest of the Indy component, like some of the other components in FireMonkey, 
just aren't compatible with iOS?

Does anyone know of a good way to send email programmatically? 

And on a side note, would there be some good documentation somewhere on all the components and classes and how to use them? Tutorials and examples are great, but they are usually limited in scope. Online help usually is very 'atomic' and doesn't explain how the various properties and methods interrelate.  I miss the old days when Delphi came with thick "Developer's Guide" books that went into complete detail on how to use the various classes & components. (sigh)

Nostalgia aside, can we send email programmatically from a Delphi iOS app?   (Bonus for similar help in sending a programmatically generated SMS or text message)

Thanks,

Joseph
2
Joseph
7/8/2013 11:17:44 PM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

4 Replies
2464 Views

Similar Articles

[PageSpeed] 59

Joseph wrote:

> Does the Indy component idSMTP work under iOS?

AFAIK, yes.

> I am trying to develop an iOS app that will periodically send an email
> as a notification of something. I'd like to also be able to send a text
> message, separately.

Doesn't iOS have its own APIs for sending emails and text messages using 
the user's configured accounts?

> I've tried to populate the idSMTP properties and it compiles and deploys
> to my iPhone just find, but when I call the method to send the email,
> the app just hangs.

On which line of code exactly?  Did you verify that your iPhone has TCP connectivity 
to the SMTP server you want to use?

> I have to wonder if idSMTP and the rest of the Indy component, like some
> of the other components in FireMonkey, just aren't compatible with iOS?

Yes, Iny is compatible with iOS.  Other people have already had success using 
TIdHTTP, TIdPOP3, and TIdIMAP on iOS, for instance.

> And on a side note, would there be some good documentation somewhere
> on all the components and classes and how to use them? Tutorials and
> examples are great, but they are usually limited in scope. Online help
> usually is very 'atomic' and doesn't explain how the various
> properties and methods interrelate.  I miss the old days when Delphi
> came with thick "Developer's Guide" books that went into complete
> detail on how to use the various classes & components. (sigh)

Indy's documentation and demos are a bit outdated.

--
Remy Lebeau (TeamB)
-1
Remy
7/8/2013 11:35:17 PM
> 
> Doesn't iOS have its own APIs for sending emails and text messages using 
> the user's configured accounts?

If it does then great! I'd love to use them. This would be much better than having the user put in settings for mail server, password, etc. 

So there must be Delphi wrappers to these API calls. Are there any docs on this, or perhaps an example? Can you point me to a particular library?

And thank you for the other info in the reply. I didn't know that prior "TCP connectivity" was required. Obviously the mail server has to be reachable, but I don't see why it wouldn't be if there is wireless connectivity of any kind. I'll look into this. 

Thanks again,

Joseph
-1
Joseph
7/8/2013 11:56:44 PM
Joseph Glosz wrote:

> If it does then great! I'd love to use them. This would be much better than having the user put in settings for mail
> server, password, etc.
> 
> So there must be Delphi wrappers to these API calls. Are there any docs on this, or perhaps an example? Can you point
> me to a particular library?

This library has wrapped the required classes:

  http://sourceforge.net/projects/dpfdelphiios/

(Specifically MFMessageComposeViewController and MFMailComposeViewController)

I don't think there's any demo for it, however I believe I could put one together.

-- 
Dave Nottage [TeamB]
1
Dave
7/9/2013 2:07:08 AM
Dave Nottage wrote:

> I don't think there's any demo for it, however I believe I could put one together.

That'll teach me to check the current source: it indeed has a demo for sending emails using the native API.

-- 
Dave Nottage [TeamB]
1
Dave
7/9/2013 2:11:58 AM
Reply:

Similar Artilces:

Sending email attachments through Outlook from Delphi programmatically
Is there some option that has to be set to allow this? I'm using ICS and it works fine for the email, but the attachment doesn't arrive. If I send to Outlook Express client, the attachment arrives. I'm sending through the same Exchange server to both clients. TIA -- -----Jon----- Am 29.01.2010 20:46, schrieb Jon Springs: > Is there some option that has to be set to allow this? > > > I'm using ICS and it works fine for the email, but the attachment doesn't > arrive. If I send to Outlook Express client, the attachment arrives. >...

Send Email with Indy smtp
-- Indy component smtp and MailMessage -- under win 32 works correct, no problems. -- under debug for IOS Device: The IOS APP hang complete! -- lines source code: MailMessage.Recipients.EMailAddresses := empfaenger ; idEmailAdress.pas: line 715 EMail.Text := TrimLeft(AList); !!!!! no error nothing app hang! here is my source code: try try MailMessage.From.Address := 'sender.adress@...' ; MailMessage.Subject := 'Hello again'; MailMessage.Body.Text := Memo...

Delphi XE4 - Firemonkey
I have an application that runs fine on windows, however when running on iOS simulator the onKeyUp event for a TEdit control is not being fired? Please advise if this event should get fired when running on iOS? This problem occurs onKeyUp events created directly on the control and by assigning the event programatically. Running XE4 update 1 iPhoneOS6.1.sdk Minimac: OS X 10.9 XCode 5 iOS Simulator Version 7.0 - iPad Retina / iOS 7.0.3(11B508) ...

Mass Email sending or Bulk sending email
  i have a Problem regarding Email sending ie : Bulk sending mails --> let me explain Clearly i have an excel sheet in that there are around 3000 Records and in that each and ever record has a unique email id( it can be either gmail , yahoo. or hotmail )so , now i need a soluction for how to send a Bulk email at a timeas i told earlier  , each record contain Unique email id , so i need to send email for individual recodes in excel with appropriate record data  for the above probm , i have writen a program with foreach loop --> it is like, i have taken a co...

Send Email Programmatically
Hi: I am developing a custom module where I will need to send an email programmatically from inside the code. Is sending emails from DNN module different from sending usually from a normal ASP.NET Page? I just have a problem in the SMTP, do I specify the SMTP? Or what? Thanks.Bilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik MVP You need to set your smtp settings under the host settings of your dnn install. If that works for mails like registrations and password reminders you can mail from within any module you want: dotnetnuke.services.mail.mail.sendmail ( ...) (or something ...

Rule to send email on startup sends multiple emails
On client 6.5.7, creating a rule to send an email upon startup results in sending a continuous stream of emails until the rule is disabled and the client is restarted. I've found TID 3325376 referring to GW7, but nothing on 6.5.x. Any thoughts would be appreciated. Thanks as always. Len Bonk Network Analyst Community Unit School District 200 Len Bonk wrote: > 3325376 That bug was marked as "invalid". This is the explanaition from development about that particular bug: "This is working as designed. each time the client starts up it will process th...

A problem to send email using Smtp
I have a proble to send an email from asp.net I do the following code to send an email: MailMessage mail=new MailMessage(); mail.From="test@server.com"; mail.To="myemailaddress@server.com"; mail.BodyFormat=MailFormat.Html; mail.Subject="testing..."; mail.Body="cool"; SmtpMail.SmtpServer="localhost"; SmtpMail.Send(mail); But I dont' receive an email when I use this method. Why is that? How can I send an email? Thanks in advance! check and see if.. -your client-side code has no errors -you imported the S...

sending email via Delphi
I am starting to use Delphi again after several years. I have Delphi 2010 with the Indy components that come with it. I want to send email from a Delphi app. I tried using the Indy components with some code I found on-line but with no success. Does anyone have some simple code that works well with the Indy components or know of a comprehensive email component I can buy. Thank you Whitney Whitney wrote: > I tried using the Indy components with some code I found on-line > but with no success. What is the actual problem you are having? What does your code actually l...

How to send email using Delphi?
In the past, I used Jedi MAPI wrapper, but it won't work in Unicode Delphi where I get "General MAPI failure" " TmpEmail := TjclEmail.Create; TmpResolve := False; try TmpResolve := TmpEmail.ResolveName(TmpStr_Name, TmpStr_Email, True); except // new code for Delphi unicode... Also gives mapi failure end; if TmpResolve then TmpEmail.Recipients.Add(TmpStr_Email) else TmpEmail.Recipients.Add('smtp:' + TmpStr_Email) ; TmpEmail.Recipients[0].Name := TmpEmail.Recipients[0].Address; TmpEmail.Subject := 'bla bla...

do-send-email, do-send-email-from-template attach a new file...
I like to do toolkit rules that report or fix things, based on a trigger attribute. Like these articles: http://www.novell.com/communities/node/6308/toolkit-rules-identity-manager-part-1 http://www.novell.com/communities/node/6310/toolkit-rules-identity-manager-part-2 http://www.novell.com/communities/node/6316/toolkit-rules-identity-manager-part-3 http://www.novell.com/communities/node/6440/toolkit-rules-identity-manager-part-4 http://www.novell.com/communities/node/6441/example-use-toolkit-rule-identity-manager http://www.novell.com/communities/node/6514/another-toolkit-rule-use-e...

Send Email from IOS and Andoid [Edit]
Hi I am trying to make an app that will send a standard email from either an Android or an ISO mobile app. The email will always go to the same address but the body will change. Can anyone point me to any sample or other code. Thanks Edited by: Bob Spencer on Jan 19, 2014 9:23 AM For iOS Matthias Eissing wrote an example: http://blogs.embarcadero.com/matthiaseissing/2013/05/03/38707/ The Blogpost is in German, but at the bottom is the whole Code. And the body has to be UrlEncoded (for example for a Space u need to write %20). For Android this Post is very interesting: http://...

I can to install one not delphi program foir iOS into one iOS for delphi?
For example i have one programm builded as xcode for iOS, and i build one program as delphi for iOS. I want to have only one instalation, i can to add this xcode program into my delphi installer of my ios program? I can to do the same as android? how i can to to this? > {quote:title=oscar mejia wrote:}{quote} > For example i have one programm builded as xcode for iOS, and i build one program as delphi for iOS. I want to have only one instalation, i can to add this xcode program into my delphi installer of my ios program? > > I can to do the same as android? how i can to to...

Firemonkey Components for to read and send emails
Hi, which componets i can to use for to build one mobile app that read and send emails from one account imap, pop3 or exchange? Where i can to see one example for to do this? Regards, Edgar Mejia ...

sending emails with attachement delphi 2009
Hi, I have a problem, I'm using delphi 2009, I made a small application that uses TIdsmtp to send mails, for attachments I'm using TIDAttachmentFile class, like with TIdAttachmentFile.Create(IdMessage1, 'c:\image1.jpg') do begin ContentType := 'image/jpeg'; FileName := 'image1.jpg'; end; SMPT.send(IdMessage1); If I dont use attachment it works fine, but with attachemtns I'm getting email with some dummy name for attachemnt like ATI1284765.dat (if I change file extension to jpg it's ok then, it's that pictu...

Web resources about - Programmatically send an email in iOS? - embarcadero.delphi.firemonkey

[...] How to Programmatically Administer Off-Facebook Pages with the Open Graph API - Inside Facebook ...
With the Open Graph protocol that Facebook announced at last week’s f8 conference, any URL can now be treated just like a Facebook Page. After ...

Well, This Is Different Time Inc. Now Selling Print Ads Programmatically
Machines are now selling some print ads at Time Inc. The nation's largest magazine publisher owner of People, Time, Sports Illustrated and InStyle ...

Now Marketers Can Buy Sponsored Content Programmatically
Publishers' branded content is going programmatic. Today, Sharethrough and AppNexus are rolling out real-time bidding for Sharethrough's news ...

Wesabe makes Financial Data available programmatically
Wesabe has just done what I've been trying to convince banks to do for years. They're making financial data available via a simple POX (Plain ...

IPG Begins Buying Local Broadcast Programmatically: Can Target, Retarget Viewers In Near Real-Time
In what likely is the most significant development yet to bring programmatic media-buying to local broadcast television, Interpublic's Mediabrands ...

Google Launches Cloud SQL API To Allow Developers To Manage Their Databases Programmatically
... to use Google’s admin interface. Today, however, Google is launching the Cloud SQL API . This new REST API will allow developers to programmatically ...

Are Programmatically Purchased Native Ads Native Enough?
It seems everyone and their mothers are pushing native ad units and tools to support them. Facebook, Twitter, Yahoo and most recently AOL all ...

Most Major U.S. Publishers Now Sell Ads Programmatically
Most major online publishers in the U.S. now sell at least some of their ad space using automated "programmatic" technology, according to new ...

TV Ads Could Soon Be Sold Programmatically, Magna’s Todd Gordon
The key efficiency new-wave digital media sales holds over TV is clear – super-targeting through addressable, automated and programmatic buying ...

How To Use Facebook's New Power Editor For Ads
Here's a guide to the power editor in Facebook's ad manager.

Resources last updated: 1/20/2016 6:48:34 PM