Sending e-mail directly from flex.

6 views
Skip to first unread message

ganapathy subramanian

unread,
Jan 3, 2010, 3:53:00 AM1/3/10
to Flex India Community
Hi,
I want to send e-mail directly to a reciepient from flex code.
Previously i was using the
the below code

var u:URLRequest = new URLRequest("mailto: ");
navigateToURL(u,”_self”);

But this opens a outlook window. what i want is send a standard
message to recipent without the user's interference.

Can someone let me know how to do it.

Thanks

Ganapathy

Kiran Kumar Vasireddy

unread,
Jan 3, 2010, 10:54:31 AM1/3/10
to flex_...@googlegroups.com
Hi Ganapathy,

I don't think directly you can send message from flex . I used to PHP code at server end to send mail to recipients . Call this PHP code from flex .

Regards
Kiran



--

You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.



Abhinav Mehta

unread,
Jan 3, 2010, 4:36:09 PM1/3/10
to flex_...@googlegroups.com
Hi
 
For that you will be needing SMTP protocol of some mail-server.
While sending the message(email) you need the smtp-address of the server, than only it can be done.....and again as Kiran told....its true that for that php or some server side language will be required to do this.
If you notice, generally while surfing, when we click on Contact Us or alike some link it invokes Outlook-express in system coz-
<a href="mailto::....etc... in html is written , similarly what you have coded in javascript is almost similar to that, the only diffrence in javascript and html is static v/s dynamic invokation; but the work is same.
 
Reagrds
Abhinav Mehta   

ganapathy subramanian

unread,
Jan 5, 2010, 5:28:29 AM1/5/10
to flex_...@googlegroups.com
Hi,
    I have a php in which i call the mail function. I had copied the php to the source folder in flex. I try to run my application using Tomcat server. But i found that the php was not getting called. Do i need to do something spl for php.
It would be helpful if you tell me how to use SMTP protocol in my application. Assume my smtp server address mail.myserver.com.
 
Thanks
Ganapathy

Kiran Kumar Vasireddy

unread,
Jan 6, 2010, 10:51:50 AM1/6/10
to flex_...@googlegroups.com
Hi Ganapathy,

PHP is server side language , You have to copy it at server end and use HTTPservice or AMFPHP to call your PHP .

Regards
Kiran

Abhinav Mehta

unread,
Jan 6, 2010, 11:15:53 AM1/6/10
to flex_...@googlegroups.com
Hello Ganapathy
 
I found the solution for SMTP-code:-
 

<?php
include("Mail.php");
/* mail setup recipients, subject etc */
$recipients = "abhina...@gmail.com";
$headers["From"] = "us...@somewhere.com";
$headers["To"] = "feed...@yourdot.com";
$headers["Subject"] = "User feedback";
$mailmsg = "Hello, This is a test.";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "smtp.mycorp.com";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "smtpusername";
$smtpinfo["password"] = "smtpPassword";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
?>

 

And for Tomcat-server cann't say, but on Apache-Http-Server 2.2(AHS) works well. For working with that AHS-server it needs configuration like first we need to install the AHS-server than there comes some php-setup, that also we have to run...and there we selects AHS 2.2 as the web-server, than it works.

In more concise- look for
 - Apache Http Server 2.2
 - Php Installer
If you make the above configuration, than I can assure you that it will works-out of your problem.

Regards
Abhinav Mehta
MSRIT- Bangalore

----- Original Message -----

Tunde Famakinwa

unread,
Jan 11, 2010, 3:52:43 AM1/11/10
to flex_...@googlegroups.com
You can send mail directly from flex using ASMAILER you can get it from google code.

--

You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.





--
Famakinwa Babatunde
Software Developer/ 3d Animator
Blog: http://dukefama.wordpress.com
Reply all
Reply to author
Forward
0 new messages