From kde-devel Thu Oct 28 18:25:44 2004 From: Richard =?iso-8859-1?q?L=E4rk=E4ng?= Date: Thu, 28 Oct 2004 18:25:44 +0000 To: kde-devel Subject: Re: Sending mail from KDE applications Message-Id: <200410282025.44894.nouseforaname () home ! se> X-MARC-Message: https://marc.info/?l=kde-devel&m=109898801312644 On Monday 25 October 2004 22.23, Ulrich Heinen wrote: > Hello everybody, > > is there a simple way to send an email from within a KDE application with > the user's mail settings without popping up a composer dialog (No, I'm not > working on a virus or trojan horse, the idea is to automatically send > application log files to an administrator)? The "official" API seems to > support only composer invokation, but I've noted some promising dcop calls > in kmail: KMailTransportServiceIface/sendMessage (however, this means that > one has to launch kmail silently). Or is there a way to retrieve the user's > mail settings from kcontrol (other than directly reading out the > appropriate kconfig) and push the mail over the smtp ioslave? Would that > require manual formatting of the message? Hi! The smtp ioslave is probably the way to go, you create an url like: smtp://smtpserver:port/send?to=toaddress&subject=mysubject&from=fromaddress and send it with kio, how you do it depends on if you want it async or sync etc. You could check out kdemultimedia/libkcddb/*smtpsubmit.* for some examples of how it's used. To get the email-address and smtp-server you can use KEmailSettings, although there were some talk about removing the setting for the smtp-server from it, don't know how it will be. Otherwise I guess you could also check in the kmail config-file or just add a setting in your own app. Richard Lärkäng > > Thanks for any hints, > > Ulrich >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<