我必须开发一个使用 javamailapi 的 android 发送邮件应用程序。
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse("mercy.krishnaveni@gmail.com,demo@mercuryminds.com"));
使用上面的代码邮件发送给收件人但现在我想发送 Id 写在以下字符串中的邮件。
string Email="mercy.krishnaveni@gmail.com"
message.setRecipients(Message.RecipientType.TO,InternetAddress.parse("Email,demo@mercuryminds.com"));
当我使用上面的代码时,邮件没有正确发送,它给了我以下错误:
01-22 07:13:31.609: E/AndroidRuntime(959): FATAL EXCEPTION: main
01-22 07:13:31.609: E/AndroidRuntime(959): java.lang.RuntimeException: javax.mail.SendFailedException: Invalid Addresses;
01-22 07:13:31.609: E/AndroidRuntime(959): nested exception is:
01-22 07:13:31.609: E/AndroidRuntime(959): com.sun.mail.smtp.SMTPAddressFailedException: 553-5.1.2 We weren't able to find the recipient domain. Please check for any
01-22 07:13:31.609: E/AndroidRuntime(959): 553-5.1.2 spelling errors, and make sure you didn't enter any spaces, periods,
01-22 07:13:31.609: E/AndroidRuntime(959): 553 5.1.2 or other punctuation after the recipient's email address. ni8sm10202402pbc.70
请帮我解决我的错误,我该如何发送电子邮件????