Podle téhle stránky ano
http://help.seznam.cz/page.php?page_id=102
Mirek Stohr
<[EMAIL PROTECTED] Komu: Java
<[email protected]>
> Kopie:
Odeslal: Předmět: Re: posilani mailu z
javy
konference-bounc
[EMAIL PROTECTED]
06.04.2006 14:05
Odpovězte prosím
uživateli Java
Nezkoumal jsem vas kod ale napadlo mne jestli vubec smtp.seznam.cz je
spravny server pro posilani posty:
$ dig seznam.cz mx
; <<>> DiG 9.3.1 <<>> seznam.cz mx
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8571
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 4
;; QUESTION SECTION:
;seznam.cz. IN MX
;; ANSWER SECTION:
seznam.cz. 426 IN MX 20 mx2.seznam.cz.
seznam.cz. 426 IN MX 10 mx1.seznam.cz.
;; AUTHORITY SECTION:
seznam.cz. 8137 IN NS ns.seznam.cz.
seznam.cz. 8137 IN NS ms.seznam.cz.
;; ADDITIONAL SECTION:
mx1.seznam.cz. 426 IN A 212.80.76.26
mx1.seznam.cz. 426 IN A 212.80.76.44
mx1.seznam.cz. 426 IN A 212.80.76.45
mx2.seznam.cz. 426 IN A 212.80.76.42
Z toho mi vyplyva, ze pokud chcete poslat mail na adresu
[EMAIL PROTECTED], musite kontaktovat server mx1.seznam.cz, v pripade ze
neodpovi zalozni je mx2.seznam.cz. Neni toto reseni vaseho problemu?
Mirek
[EMAIL PROTECTED] napsal(a):
> Snažím se odeslat mail z javovského programu, ale zatím bezůspěšně.
Všechny
> pokusy připojit se na seznam končí
> "Unknown SMTP host: smtp.seznam.cz"
>
> Zde (viz dole) jsem naše kód, který by měl snad fungovat , ale
> nefunguje, stejně jako všechny předchozí pokusy. Netušíte prosím někdo
> nějaký háček ?
> Díky. J.N.
>
>
>
> http://forum.java.sun.com/thread.jspa?threadID=615715&tstart=0
>
>
>
>
-----------------------------------------------------------------------
> ----------
> Without SSL connection, Normal SMTP
>
-----------------------------------------------------------------------
> --------
> import java.util.Properties;
> import javax.mail.*;
> import javax.mail.internet.*;
> import javax.activation.*;
> import java.io.UnsupportedEncodingException;
> import java.security.*;
> import java.util.Properties;
> import javax.mail.*;
> import javax.mail.internet.InternetAddress;
> import javax.mail.internet.MimeUtility;
> public class AttachExample {
> public static void main (String args[]) throws Exception
> {
> System.getProperties().put("proxySet","true");
> System.getProperties().put("socksProxyPort","1080"); // ip
> adresa a port proxy
> System.getProperties().put("socksProxyHost","192.168.155.1");
> Properties props = System.getProperties();
>
> String from = "[EMAIL PROTECTED]";
> String to = "[EMAIL PROTECTED]";
> String filename = "AttachExample.java";
>
>
> // Get system properties
> final String username = "USERNAME"; // jmeno a heslo z
> mailoveho uctu
> final String password = "PASSWORD";
>
> props.put("mail.user", username);
> props.put("mail.host", "smtp.seznam.cz");
> props.put("mail.debug", "true");
> props.put("mail.store.protocol", "pop3");
> props.put("mail.transport.protocol", "smtp");
>
>
> Session session = Session.getDefaultInstance(props,
> new Authenticator(){
> protected PasswordAuthentication
> getPasswordAuthentication() {
> return new
> PasswordAuthentication(username, password);
> }});
>
> // Define message
> Message message = new MimeMessage(session);
> message.setFrom(new InternetAddress(from));
> message.addRecipient(Message.RecipientType.TO, new
> InternetAddress(to));
> message.setSubject("Hello JavaMail Attachment");
> // Create the message part
> BodyPart messageBodyPart = new MimeBodyPart();
> // Fill the message
> messageBodyPart.setText("Here's the file");
> // Create a Multipart
> Multipart multipart = new MimeMultipart();
> // Add part one
> multipart.addBodyPart(messageBodyPart);
> // // Part two is attachment // // Create second body part
> messageBodyPart = new MimeBodyPart();
> // Get the attachment
> DataSource source = new FileDataSource(filename);
> // Set the data handler to the attachment
> messageBodyPart.setDataHandler(new DataHandler(source));
> // Set the filename
> messageBodyPart.setFileName(filename);
> // Add part two
> multipart.addBodyPart(messageBodyPart);
> // Put parts in message
> message.setContent(multipart);
> // Send the message
> Transport.send(message);
> }
> }
>
>
>
>
>
>
>
>
>
>
>
>