Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法从BlackBerry发送电子邮件-JDE4.7_Blackberry_Java Me_Blackberry Jde - Fatal编程技术网

无法从BlackBerry发送电子邮件-JDE4.7

无法从BlackBerry发送电子邮件-JDE4.7,blackberry,java-me,blackberry-jde,Blackberry,Java Me,Blackberry Jde,你在模拟器上运行这个吗?如果是,是哪种开发环境(eclipse或JDE)?您是否启动了MDS或正在使用ESS?(使用MDS 4,您不需要ESS。) 就我个人而言,我将eclipse与插件一起使用,然后设置运行时配置以启动MDS 但是,在执行此操作之前,您需要编辑rimpublic.property文件,将其配置为连接到您的电子邮件服务器(如果您使用的是远程电子邮件服务器)。如果要使用本地邮件客户端,请将MDS配置为将其用作传递 让我知道您的设置/配置是什么,我将尽力提供更多帮助。您是否收到任何错

你在模拟器上运行这个吗?如果是,是哪种开发环境(eclipse或JDE)?您是否启动了MDS或正在使用ESS?(使用MDS 4,您不需要ESS。)

就我个人而言,我将eclipse与插件一起使用,然后设置运行时配置以启动MDS

但是,在执行此操作之前,您需要编辑rimpublic.property文件,将其配置为连接到您的电子邮件服务器(如果您使用的是远程电子邮件服务器)。如果要使用本地邮件客户端,请将MDS配置为将其用作传递


让我知道您的设置/配置是什么,我将尽力提供更多帮助。

您是否收到任何错误或异常?
Store store = Session.getDefaultInstance().getStore();
Folder[] folders = store.list(Folder.SENT);
Folder sentfolder = folders[0];
// Create message.
Message msg = new Message(sentfolder);
// Add TO Recipients.
Address toList[] = new Address[1];
try {
toList[0]= new Address("someemail@email.com", "Some Email");
} catch(AddressException e) {
System.out.println(e.toString());
}
try {
msg.addRecipients(Message.RecipientType.TO, toList);
} catch (MessagingException e) {
System.out.println(e.toString());


}
// Add CC Recipients.
Address ccList[] = new Address[1];
try {
ccList[0]= new Address("someemail@gmail.com", "some address");
} catch(AddressException e) {
System.out.println(e.toString());
}
try {
msg.addRecipients(Message.RecipientType.CC, ccList);
} catch (MessagingException e) {
System.out.println(e.toString());
}
// Add the subject.
msg.setSubject("A Test Email");
// Add the message body.
try {
msg.setContent("This is a test message.");
} catch(MessagingException e) {
// Handle messaging exceptions.
}
// Send the message.
try {
Transport.send(msg);
} catch(MessagingException e) {
System.out.println(e.getMessage());
}
System.out.println("Email sent successfully.");