Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
import com.coltware.airxmail.INetAddress;
import com.coltware.airxmail.MailSender.SMTPSender;
import com.coltware.airxmail.MimeMessage;
import com.coltware.airxmail.RecipientType;
protected function send_plain_Mail():void
{
       var sender:SMTPSender = new SMTPSender();
       sender.setParameter(SMTPSender.HOST, "smtp.gmail.com");
       sender.setParameter(SMTPSender.PORT, 465);
       sender.setParameter(SMTPSender.AUTH, true);
       sender.setParameter(SMTPSender.USERNAME, "username");
       sender.setParameter(SMTPSender.PASSWORD, "password");
       var message:MimeMessage = new MimeMessage();
       var from:INetAddress = new INetAddress("wtf@gmail.com","from label");
       message.setFrom(from);
       var toRecpt:INetAddress = new INetAddress("abc@gmail.com","to label");
       message.addRcpt(RecipientType.TO, toRecpt);
       message.setSubject("Hello World");
       message.setTextBody("this is my first mail from flex");
       sender.send(message);
       sender.close();
}


i have used this code to email in flex..
but its not working..
Posted
Updated 20-May-12 21:08pm
v2

1 solution

Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...

A very quick search using your subject as the search term gave 33 million hits: https://www.google.co.uk/search?sugexp=chrome,mod=10&sourceid=chrome&ie=UTF-8&q=send+an+email+in+flex[^]

This one from the top three gives a couple of ways: http://www.justskins.com/forums/sending-email-with-flex-75914.html[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900