Sending an email through J2ME

What is the easiest way to send an email to an email account using J2ME?
I browsed google, and all of the results appeared very complex. Is there a simple way to do it (like you can with PHP)?
Thanks!

My phone doesn't have a mobile mailer.
I can't believe emailing is so difficult!
Would this solution work:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import java.io.*;
import java.util.*;
public class Emailer
     String url;
     String to;
     String from;
     String subj;
     String msg;
     HttpConnection conn;
     OutputStream output;
     public Emailer(String url, String to, String from, String password,
                                            String subj)
          this.url = url;
          this.to = to;
          this.from = from+"/"+password;
          this.subj = subj;
     public boolean sendEmail(String msg)
          this.msg = msg;
          try
               StringBuffer buffer = new StringBuffer();
               buffer.append("To: " + to);
               buffer.append("From: " + from);
               buffer.append("Subject: " + subj);
               buffer.append("Message: " + msg);
               conn = (HttpConnection) Connector.open(url);
               conn.setRequestMethod(HttpConnection.POST);
               output = conn.openOutputStream();
               int i = 0;
               char c;
               while((c = buffer.charAt(i)) != 0)
                    output.write(c);
                    i++;
          catch (Exception e)
               return false;
          return true;
}I tried it, but I never got the email...
Also, is there a simple way to read from .txt files?
Thanks!

Similar Messages

  • Can LabVIEW send an email through Microsoft Exchange server without an account set up in Outlook?

    I've found sample code that shows how to send email through Outlook using LabVIEW.  On any computer I log into on our network, my profile loads and I have access to the exchange server through Outlook so the code works.
    However, I am developing a program that will run on a lab computer with a generic PC login that is shared among everyone in the lab.  Exchange server/outlook is not set up for the generic user.
    Is it possible to have labVIEW send an email through the exchange server with a server name, username, and password coded into the executable?

    You would need to send a standard SMTP message via Exchange. The Exchange server will likely require authentication, so you won't be able to use the built-in SMTP VIs, as they do not support authentication. If you're on Windows you can use .NET (see this example), or use the OpenG SMTP VIs.

  • Why I can't  send my email through my Ipad 3?

    I don't know what to do. everytime I send my email through my ipad 3 , It said because of outsider server but I think it is not correct . cos my friend can send it but me not so what shoud i do?

    Sann Raksmey wrote:
    why when I connect my Ipad3 to my Window Computer it does not charge? I mean my ipad not charge like when I connect it with other App Computer at Apple Store?
    The quickest way (and really the only way) to charge your iPad is with the included 10W USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    Tips About Charging for New iPad 3
    http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
     Cheers, Tom

  • Sending an email through JavaMail

    Hi
    I am trying to send an email through JavaMail, the jsp page which is sending the mail is called testmail.jsp. Code snippet:
    try
    InternetAddress toAddress = new (InternetAddress"xxxxxxxx","xxx");
    InternetAddress fromAddress = new InternetAddress("xxxxxxx","xxxxxx");
    Properties props = new Properties();
    props.put("mail.smtp.host", "xxxxxxxx");
    Session mailsession = Session.getDefaultInstance(props, null);
    Message msg = new MimeMessage(mailsession);
    msg.addRecipient(Message.RecipientType.TO, toAddress);
    msg.setSubject("A Simple E-mail Message!");
    msg.setFrom(fromAddress);
    msg.setText("Hi\rThis message has been sent from a JSP page.\nBye\rTest");
    Transport.send(msg);
    %>
    <b>An e-mail has been sent.</b>
    <%
    catch (Exception e)
    e.printStackTrace();
    When i send the email to my own email address(on the same domain where the actual testmail.jsp is hosted) my mail is being sent successfully. BUT when i try sending to eg. a hotmail address I just get a blank page with no errors (from Tomcat) and no mail is sent.
    PLEASE HELP. Is it something to do with the protocol or am I doing something wrong
    THANKS LODES
    sabcarina

    Basically, it's fine. The only thing I could see (other than adding imports, etc.) was that there was an extra open parenthesis in the first InternetAddress declaration. This is my complete JSP, which worked fine for me:<%@ page import="javax.mail.*" %>
    <%@ page import="javax.mail.internet.*" %>
    <%@ page import="java.util.*" %>
    <%
    try {
       InternetAddress toAddress = new InternetAddress("[email protected]","Bill Gates");
       InternetAddress fromAddress = new InternetAddress("[email protected]","Hotmail");
       Properties props = new Properties();
       props.put("mail.smtp.host", "smtp.server.address");
       Session mailsession = Session.getDefaultInstance(props, null);
       Message msg = new MimeMessage(mailsession);
       msg.addRecipient(Message.RecipientType.TO, toAddress);
       msg.setSubject("A Simple E-mail Message!");
       msg.setFrom(fromAddress);
       msg.setText("Hi\rThis message has been sent from a JSP page.\nBye\rTest");
       Transport.send(msg);
       %>
          <b>An e-mail has been sent.</b>
       <%
    } catch (Exception e) {
       e.printStackTrace();
    %>Bob

  • Sending an email through JSP and WML

    I am trying to send an email through jsp in wml, i think i have everything set up properly with regards to tomcat however I keep getting the error
    "Invalid element 'PCDATA' in context of card expected on event ....."
    The line of code in which this occurs is           
    <jsp:setProperty name="mailer" property="*"/>
    I was wondering if anyone would be able to help me with this and be able to tell me why it thinks this is PCDATA and not jsp code.
    Any help would be much appreciated.

    Check out:
    http://jakarta.apache.org/taglibs/index.html

  • Can we send bulk email through exchange server 2010

    can we send bulk email through exchange server 2010

    You can do this however not sure I would recommend that since if people complain they are getting spammed it could effect your production servers domain/IP, i.e. it could get black listed.   Personally I always recommend using a different system for
    email blast  to protect my production IP addresses and also to keep the load off of exchange as well as email marketing systems have built in capabilities for reporting, opt in/out capabilities etc.
    All of that said perhaps you can tell us more about what exactly it is you want to do and how often?
    Search, Recover, & Extract Mailboxes, Folders, & Email Items from Offline Exchange Mailbox and Public Folder EDB's and Live Exchange Servers or Import/Migrate direct from Offline EDB to Any Production Exchange Server, even cross version i.e. 2003 -->
    2007 --> 2010 --> 2013 with Lucid8's
    DigiScope

  • TS4002 I am not recieving or sending any emails through iCloud on any device.

    I go to my email through my iPhone 4, Not updated software, last received email is dated 11/5/13. I go onto my Dell computer and still nothing in my emails. I tried sending an email if I go into my sent does not show up or nether in my draft. I even tried emailing a blank email to my account from a different and nothng. What is going on?

    OK. I just had this exact issue. You need to go into your icloud.com account on the web and then click on your Trash. Then click on the gear in the lower left corner and select "empty trash." If you're just deleting things you're not really freeing up space because it's still in your trash.
    REALLY irritating... I missed a whole bunch of important emails due to this and NEVER not a notification.

  • Sending an email through a swing application

    Can anyone please tell me how can I send an emil through a Java Swing application.
    I am lookin g for something like,on clicking on a button microsoft outlook application should open up.

    I don't have the code with me right now, but I had to do a simple interface for a friend of my for templated emails.
    Anyway, with I did was go into Outlook Express and save an email to see the extension and format. Then streamed the email I wanted out to a local file in that format followed by a Systeme.exec() on the file name to allow windows to launch outlook and open the file.
    Not the cleanest solution as far as portability, but it was quick.

  • Sending an email through jsp

    is there any facility to send an email to persons through jsp

    Check out:
    http://jakarta.apache.org/taglibs/index.html

  • Airport Extreme Won't Allow iMail to Send out Emails through POP or IMAP

    So we just got the Airport Extreme and the internet is working just fine, but on both my macbook and my Father's iMac we can't send emails through our iMail. Mine is connected to my gmail account and his is connected to a comcast account. We can both receive email, but not send it out, it just sits in the outbox attempting to send itself.
    I tried resetting my account, and deleted it altogether and made a new one, but that still didn't work.
    Any other ideas?

    OS X Mail: Troubleshooting sending and receiving email messages

  • Not able to send yahoo emails through 'Mail' with attachments size 5 MB or more.

    Hi all,
    I am not able sent mails though 'MAIL' with attachment size more than 5Mb or more. I am using macbook pro and 10.8.3 OS X. Can anyone tell me how we can sent mails with resonable size? pls note that I want to send mails with actual size.
    I am using yahoo for sending mails.
    Regards,
    Amit

    All email service providers have a size limit on sending an email.  See the following link for info on yahoo mail's file size restrictions, and ensure you are within this restriction.
    - http://answers.yahoo.com/question/index?qid=20100326083940AAQgBa5.

  • Can't attach some files when sending an email through Safari (via Gmail)

    I'm trying to send an email to myself, and I can't seem to attach files that were created using iWork programs (Pages, Numbers etc.) How can I get Safari/Gmail to allow me to email these files?

    I can't seem to attach files that were created using iWork programs (Pages, Numbers etc.)
    These are not files; they are folders that appear as files to the user. To email them to anyone you must create an archive (.zip file) of them and email that archive to the recipient.
    Mulder

  • Sending mass email through macmail

    MacMail: I'm wondering if there's an easy way to send an email (notice of changed email address) to all those who have ever emailed me in the past.

    If you have all of those email addresses in your Address Book you can go to the View menu and select Groups. There should be a group called All Contacts. Select that group, then click on one member of the group. Next go to the Edit menu and choose Select All (or do Command-A on your keyboard.) Now drag those contacts into the To: field of your email.
    Unfortunately if you have not put all the people you want to send this to into your address book, I do not believe there is any other way.
    Note that depending on the number of people you send to, your ISP or mail service provider may object to mass emailing.
    Best of luck.

  • When sending an email through windows live I get an error message from WebKit2WebProcess.exe

    Hi,
    Every time when I try and send an email from windows live I get an error message from WebKit2WebProcess.exe.
    Not sure if I deactivate this from Windows live whether I will compromise my security.
    Any advice would be helpful.
    Thanks,
    Becky

    Thank you Matt. I'm sure this will be frustrating ...but the more I think about this problem there more info I have to share. The emails I write that do not get sent do end up in my "sent" folder but never reach the recipient. And, most perplexing, the issue/problem is sporadic. It was coming and going before I switched over to the SSL/TLS option in T-bird. And...since the switch it has reappeared and disappeared. I have made zero changes other than the above mentioned. I did get a security update today for T-bird perhaps this will help?
    I read your link, thank you.
    I obviously don't understand how these systems work. I'm baffled how an issue like this can come and go...

  • Send an email through flash app? cs4

    hi
    just wondering if anyone could let me know how i would go about setting up my flash app to send an email when the submit button is pressed?
    I know i need to use php but everytime i try it doesnt work, i read i need to add code to my server, although this application isnt meant for the web as such its more a local application whereby the user can type a message when they require help and send it over the internet to my mailbox
    hope you can help
    thanks
    fonzio

    hello again
    still having trouble with this issue
    ive decided to go for the open outlook option
    problem is if i type a subject into my subject area (subject_txt.text), and a message into my message area (body_txt.text)
    using this code
    conbtns_mc.btn_submit_mc.addEventListener(MouseEvent.CLICK, contactclick)
    function contactclick (event:MouseEvent):void{
    navigateToURL(new URLRequest("mailto:[email protected]?subject=subject_txt.text&body=body_txt.text"));
    then the email generated in outlook has a subject heading of
    subject_txt.text
    and the body has
    body_txt.text
    how can i get the values inserted into my textboxes into outlook when i click submit?
    many thanks in advance
    fonzio

Maybe you are looking for

  • How can I change my e-mail address ?

    Hi, How can I change my e-mail address? I am trying to edit my e-mail address from "Control Panel" but It is unchangeable so I cannot modify it. Please help me how can I do that? Zafer

  • BootCamp will not install in Windows Vista

    I installed Windows Vista on my MBP 17" OSX (10.6.4) with no problems. The problem is now when I go to the Vista side, and try to install BootCamp drivers, I get a message saying "Boot Camp x64 is unsupported on this computer model". Does any one kno

  • Is there any way to turn missing photos back into printable jpegs?

    Using LR 5.  Lost about 1500 jPeg images due to corrupted disk drive.  However, LR5 still displays a remarkably sharp image under "missing photos".  Is there any way to turn these back into printable jpegs?  These are family vacation photos that had

  • LOGO in report painter

    HI Guru's. I want to add Logo in report developed in report painter. we have developed Balance sheet report with help of report painter. now i client want their logo on top of this report. So please advice on this issue. thanks in advance.

  • ORG unit & SUB units download

    Hi All, I needs to download all ORG units and Sub units, Cost center, Positions. Is there any report available. Thanks...