Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
krishna mohan mathakala
Problem with from address in mail in liferay
20 de enero de 2014 21:25
Respuesta

krishna mohan mathakala

Ranking: New Member

Mensajes: 20

Fecha de incorporación: 31 de enero de 2013

Mensajes recientes

Hi ,
I am working with liferay 6.0.6. I am using gmail smtp server to send emails from liferay .
In mail configuration I used a gmai Id ="abc@gmail.com".
I want to set from address = "xyz@yahoo.com".

While preparing email , even though I set from address as " xyz@yahoo.com ", by using InternetAddress fromAddress = new InternetAddress("xyz@yahoo.com");
but the mail is showing from address of " abc@gmail.com".
How can i resove this .?
Sushil Patidar
RE: Problem with from address in mail in liferay
21 de enero de 2014 4:19
Respuesta

Sushil Patidar

Ranking: Expert

Mensajes: 308

Fecha de incorporación: 30 de octubre de 2011

Mensajes recientes

Hi,
Can you please make it more clear? .Please mention the lines of code you are using to understand the problem properly.


Thanks
krishna mohan mathakala
RE: Problem with from address in mail in liferay
22 de enero de 2014 21:41
Respuesta

krishna mohan mathakala

Ranking: New Member

Mensajes: 20

Fecha de incorporación: 31 de enero de 2013

Mensajes recientes

Hi sushil patidar ,
In my mail configuration while configuring gmail smtp mail serverI used my gmail id(krishna@gmail.com) .
My method has following code .

InternetAddress fromAddress = new InternetAddress("admin@krishnaorg.com");
InternetAddress toAddress = new InternetAddress(emailIdsArray);
MailMessage mailMessage = new MailMessage(
fromAddress,toAddress , subject ,mailBody , true);
MailServiceUtil.sendEmail(mailMessage);


When i send a mail. The mail have from address "krishna@gmail.com", but I want from address to be " admin@krishnaorg.com ".

How can I achieve this??
Meera Prince
RE: Problem with from address in mail in liferay
23 de enero de 2014 20:14
Respuesta

Meera Prince

Ranking: Liferay Legend

Mensajes: 1110

Fecha de incorporación: 8 de febrero de 2011

Mensajes recientes

HI

Use following code and try it may work


com.liferay.util.mail.MailEngine.send(InternetAddress from, InternetAddress to, String subject,String body, boolean htmlFormat);

if its bulk mail sending then use following method

com.liferay.util.mail.MailEngine.send(InternetAddress from, InternetAddress[] to, InternetAddress[] cc,String subject, String body, boolean htmlFormat);

InternetAddress[] cc for you can pass null if you don't have cc addresses
krishna mohan mathakala
RE: Problem with from address in mail in liferay
6 de febrero de 2014 21:17
Respuesta

krishna mohan mathakala

Ranking: New Member

Mensajes: 20

Fecha de incorporación: 31 de enero de 2013

Mensajes recientes

This is also not working
karthik reddy
RE: Problem with from address in mail in liferay
7 de febrero de 2014 2:21
Respuesta

karthik reddy

Ranking: Junior Member

Mensajes: 50

Fecha de incorporación: 8 de abril de 2013

Mensajes recientes

Mail Sending in LiferayHi try this link