Foren

need help in web form

sandeep tripathi, geändert vor 11 Jahren.

need help in web form

Regular Member Beiträge: 100 Beitrittsdatum: 19.10.11 Neueste Beiträge
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
thumbnail
Vitaliy Koshelenko, geändert vor 11 Jahren.

RE: need help in web form

Expert Beiträge: 319 Beitrittsdatum: 25.03.11 Neueste Beiträge
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, geändert vor 11 Jahren.

RE: need help in web form

Regular Member Beiträge: 100 Beitrittsdatum: 19.10.11 Neueste Beiträge
Hi Vitaliy ,

thanks it is working for me too.
sandeep tripathi, geändert vor 11 Jahren.

RE: need help in web form

Regular Member Beiträge: 100 Beitrittsdatum: 19.10.11 Neueste Beiträge
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