My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.lineadecodigo.java.mail;

/**
* @file AutentificarSMTP.java
* @version 1.0
* @author Linea de Codigo (http://lineadecodigo.com)
* @date 26.marzo.2011
* @url http://lineadecodigo.com/java/autentificandose-con-smtp/
* @description Clase que autentifica contra un servidor SMTP
*/

import java.util.*;
import javax.mail.*;

public class AutentificarSMTP {


public static void main(java.lang.String[] args) {

try {

// Configuramos las propiedades
Properties props = new Properties();
props.put("mail.transport.protocol","smtp");
props.put("mail.smtp.host","mail.lineadecodigo.com");

// Creo la sesión y un nuevo mensaje de correo
Autentificacion pwd = new Autentificacion();
Session mailSession = Session.getInstance(props,pwd);

System.out.println(mailSession.toString());

} catch (Exception e) {
e.printStackTrace();
}

}
}

Change log

r349 by vcuervo on Mar 25, 2011   Diff
Autentificar SMTP
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 940 bytes, 38 lines
Powered by Google Project Hosting