0

Hi, could anyone help me with gmail api?

I need to send a message from gmail using gmail api (java)

4th Feb 2020, 7:38 AM
Инна Алексеевна
Инна Алексеевна - avatar
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.
4th Feb 2020, 3:45 PM
Tibor Santa
Tibor Santa - avatar
+ 3
Hi, lucky one In the docs there is an example for it https://developers.google.com/gmail/api/guides/sending
4th Feb 2020, 7:41 AM
Oma Falk
Oma Falk - avatar
+ 2
can u explain the problem?
4th Feb 2020, 7:44 AM
Oma Falk
Oma Falk - avatar
+ 1
Thanks, importing javax. mail resolved the issue
7th Feb 2020, 7:57 AM
Инна Алексеевна
Инна Алексеевна - avatar
0
I have seen that example, but i cannot make it to work in my app
4th Feb 2020, 7:43 AM
Инна Алексеевна
Инна Алексеевна - avatar
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
4th Feb 2020, 7:57 AM
Инна Алексеевна
Инна Алексеевна - avatar