0
Hi, could anyone help me with gmail api?
I need to send a message from gmail using gmail api (java)
6 Respuestas
+ 1
The google documentation refers to this:
Creating an email message can be greatly simplified with the MimeMessage class in the javax.mail.internet package.
I thinks this falls under java enterprise edition, so maybe you need to use java ee sdk or jakarta ee to make it work. But I am not sure.
+ 3
Hi,
lucky one
In the docs there is an example for it
https://developers.google.com/gmail/api/guides/sending
+ 2
can u explain the problem?
+ 1
Thanks, importing javax. mail resolved the issue
0
I have seen that example, but i cannot make it to work in my app
0
I tried to use this example, but som classes were colored with red and i cannot import them.
Ex: 1)createEmail:
MimeMessage is colored with red, i can replace it with MIMEMessage type, but then [MIMEMessage email = new MIMEMessage(session);] row says 'cannot resolve constructor' and i cannot use any methods with email object. my problem is with correct import as I see
2)createEmail:
When i import Session, i cannot use getDefaultInstance method
import org.openqa.selenium.remote.server.Session;
Session session = Session.getDefaultInstance(props, null);
3)createMessageWithEmail:
emailContent.writeTo(buffer);
writeTo method also cannot be used