Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
sandeep tripathi
need help in web form
20 settembre 2012 9.20
Risposta

sandeep tripathi

Punteggio: Regular Member

Messaggi: 100

Data di Iscrizione: 19 ottobre 2011

Messaggi recenti

Hi All,

i am trying to create registration from using web form but i am not able to get 2 think
1) how can i use date in web form .
2) how can i confirm email setting .

i had saw email setting for gmail and i had added the given setting in my root.xml in conf/catalina/localhost
but it give error failed to connect valid smtp server please make sure it is properly configured could not connect smtp host
Vitaliy Koshelenko
RE: need help in web form
20 settembre 2012 9.42
Risposta

Vitaliy Koshelenko

Punteggio: Regular Member

Messaggi: 240

Data di Iscrizione: 25 marzo 2011

Messaggi recenti

Hi!
For email configuration go to CP -> Server Administration -> Mail and configure following settings:

pop.gmail.com
995

checked radio button

{you gmail account}
{you gmail password}

smtp.gmail.com
465

checked radio button

{you gmail account}
{you gmail password}

They are working for me.
sandeep tripathi
RE: need help in web form
21 settembre 2012 3.20
Risposta

sandeep tripathi

Punteggio: Regular Member

Messaggi: 100

Data di Iscrizione: 19 ottobre 2011

Messaggi recenti

Hi Vitaliy ,

thanks it is working for me too.
sandeep tripathi
RE: need help in web form
7 novembre 2012 23.07
Risposta

sandeep tripathi

Punteggio: Regular Member

Messaggi: 100

Data di Iscrizione: 19 ottobre 2011

Messaggi recenti

hi Everyone,

need help in functionality of sending mail ,in liferay we have to specify username and pass word my client do not want to use that ,so i had remove all the setting ,we have a mail server which we can use so i try code for sendinfg mail in my portlet but it will be exception
javax.mail.messageexception could not connect to smtp host :smtp.gmail.com port :25 and connect time out

System.out.println("data inserted in taptrackmail ");

Properties props = new Properties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "false");
props.put("mail.debug", "false");
props.put("mail.smtp.ssl.enable", "true");

// Get session
Session session = Session.getInstance(props);
try {
// Instantiate a message
Message msg = new MimeMessage(session);
// Set the FROM message
msg.setFrom(new InternetAddress(email));
// The recipients can be more than one so we use an array but you can
// use 'new InternetAddress(to)' for only one address.
InternetAddress[] address = {new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO, address);
// Set the message subject and date we sent it.
msg.setSubject(subject);

// Set message content
MimeBodyPart messageBodyPart = new MimeBodyPart();
MimeBodyPart messageBody = new MimeBodyPart();
messageBody.setContent(text, "text/html");
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBody);
multipart.addBodyPart(messageBodyPart);

msg.setContent(multipart);

Transport transport = session.getTransport("smtp");
// Send the message
transport.connect();
transport.sendMessage(msg, address);

transport.close();
//Transport.send(msg);
System.out.println("mail send");
}
catch (Exception e ) {
System.out.println("exception+++++"+e);
}

can some one help me out what i am doing wrong !!!

Thanks and Regards
Sandeep