Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 12
  1. #1

    Aiuto ho problema invio con JavaMail[JSP]

    Buon pomeriggio,sto realizzando l'invio di un'e-mail con java e jsp!
    Ho importato i jar,all'interno del server e i package che servono per realizzare la mia email!
    Questo è il codice non tutto..:

    <%
    //Occorre sostituire il valore host con info valide
    //host - deve essere un server smtp valido a cui si ha attualmente accesso

    String host="yourmailhost";

    String to= request.getParameter("to");
    String from = request.getParameter("from");
    String subject = request.getParameter("subject");
    String messageText = request.getParameter("body");
    boolean sessionDebug = false;

    //Crea alcune proprietà e ottiene la Session di default
    Properties props = System.getProperties();
    props.put("mail.host",host);
    props.put("mail.transport.protocol","smtp");

    Session mailSession = Session.getDefaultInstance(props,null);

    //Imposta il debug sulla Session in modo che si possavedere che cosa accade
    //Passando false non si attiva l'echo delle informazioni di debug passando true lo si attiva
    mailSession.setDebug(sessionDebug);
    %>

    Il problema è che non so che valore vuole per la variabile Host,e cioè questa:
    String host="yourmailhost";
    Devo sostituire il valore attuale con uno effettivo
    Ho provato con www.tiscalinet.it,con tiscalinet.it,solo con tiscalinet ma niente da fare
    Sapete cortesemente qual'è il valore effettivo che devo inserire per la variabile Host?
    vi prego aiutatemi......
    Grazie a tutti....ciao

  2. #2
    quello che utilizzi per inviare le mail...
    potrebbe essere mail.tiscali.it o roba del genere

    tuttavia devi controllare che il server mail ti permetta di inviare le mail: ultimamente per sfruttare l'invio delle mail devi essere connesso solo con la connessione che ti fornisce chi ti offre la mail

    ad esempio x spedire mail da libero devi essere connesso con libero ecc ecc
    23-08-2005: Udinese in cémpions lìg
    Questa estate l'ho passata a Tallin

  3. #3

    re:--

    Grazie per avermi risposto...
    effettivamente. uso tiscali sia per la connessione.... sia come server di posta... ho due indirizzi di posta....

    Adesso provo come hai detto te...e tra un momento ti faccio sapere..

    ok?
    grazie milleee....

  4. #4
    Con mail.tiscalinet.smtp non funziona e mi da ques'errore....

    Error page exception
    The server cannot use the error page specified for your application to handle the Original Exception printed below. Please see the Error Page Exception below for a description of the problem with the specified error page.


    Original Exception:
    Error Message: Sending failed; nested exception is: javax.mail.MessagingException: Could not connect to SMTP host: mail.tiscali.it, port: 25; nested exception is: java.net.NoRouteToHostException: Operation timed out: no further information
    Error Code: 500
    Target Servlet: null
    Error Stack:
    javax.mail.SendFailedException: Sending failed;
    nested exception is:
    javax.mail.MessagingException: Could not connect to SMTP host: mail.tiscali.it, port: 25;
    nested exception is:
    java.net.NoRouteToHostException: Operation timed out: no further information
    at javax.mail.Transport.send0(Transport.java:218)
    at javax.mail.Transport.send(Transport.java:80)
    at _MailExample_jsp_6._jspService(_MailExample_jsp_6. java:126)
    at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:142)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    at org.apache.jasper.runtime.JspServlet$JspServletWra pper.service(JspServlet.java:300)
    at org.apache.jasper.runtime.JspServlet.serviceJspFil e(JspServlet.java:430)
    at org.apache.jasper.runtime.JspServlet.service(JspSe rvlet.java:565)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    at com.ibm.servlet.engine.webapp.StrictServletInstanc e.doService(ServletManager.java:827)
    at com.ibm.servlet.engine.webapp.StrictLifecycleServl et._service(StrictLifecycleServlet.java:167)
    at com.ibm.servlet.engine.webapp.IdleServletState.ser vice(StrictLifecycleServlet.java:297)
    at com.ibm.servlet.engine.webapp.StrictLifecycleServl et.service(StrictLifecycleServlet.java:110)
    at com.ibm.servlet.engine.webapp.ServletInstance.serv ice(ServletManager.java:472)
    at com.ibm.servlet.engine.webapp.ValidServletReferenc eState.dispatch(ServletManager.java:1012)
    at com.ibm.servlet.engine.webapp.ServletInstanceRefer ence.dispatch(ServletManager.java:913)
    at com.ibm.servlet.engine.webapp.WebAppRequestDispatc her.handleWebAppDispatch(WebAppRequestDispatcher.j ava:523)
    at com.ibm.servlet.engine.webapp.WebAppRequestDispatc her.dispatch(WebAppRequestDispatcher.java:282)
    at com.ibm.servlet.engine.webapp.WebAppRequestDispatc her.forward(WebAppRequestDispatcher.java:112)
    at com.ibm.servlet.engine.srt.WebAppInvoker.doForward (WebAppInvoker.java:91)
    at com.ibm.servlet.engine.srt.WebAppInvoker.handleInv ocationHook(WebAppInvoker.java:184)
    at com.ibm.servlet.engine.invocation.CachedInvocation .handleInvocation(CachedInvocation.java:67)
    at com.ibm.servlet.engine.srp.ServletRequestProcessor .dispatchByURI(ServletRequestProcessor.java:122)
    at com.ibm.servlet.engine.oselistener.OSEListenerDisp atcher.service(OSEListener.java:315)
    at com.ibm.servlet.engine.http11.HttpConnection.handl eRequest(HttpConnection.java:60)
    at com.ibm.ws.http.HttpConnection.readAndHandleReques t(HttpConnection.java:323)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection. java:252)
    at com.ibm.ws.util.CachedThread.run(ThreadPool.java:1 22)

    Chi capisce che errore mi ha restituito?
    Secondo me è sbagliato il valore che devo mettere per la variabile Host !!

    Chi sa qualcosa?
    Grazie....

  5. #5
    Originariamente inviato da ANTAGONIA
    Con mail.tiscalinet.smtp non funziona e mi da ques'errore....


    Original Exception:
    Error Message: Sending failed; nested exception is: javax.mail.MessagingException: Could not connect to SMTP host: mail.tiscali.it, port: 25; nested exception is: java.net.NoRouteToHostException: Operation timed out: no further information
    Error Code: 500

    Chi capisce che errore mi ha restituito?
    Secondo me è sbagliato il valore che devo mettere per la variabile Host !!

    Chi sa qualcosa?
    Grazie....
    banalmente non riesce a collegarsi con l'host
    23-08-2005: Udinese in cémpions lìg
    Questa estate l'ho passata a Tallin

  6. #6
    Ok come dici te è banale...

    Ma allora come posso risolvere questo problema?
    E' possibile che per inviare un'email sia cosi difficile?

    Sapresti cortesemente darmi una mano a risolvere il problema?

    Grazie... Pippo75

  7. #7
    basta che utilizzi una connessione con tiscali, metti il mail server corretto e anche username e password
    Poi dovrebbe essere tutto a posto
    caso mai fai un giro sul
    sito della sun, fra i tutorial proposti mi ricordo essercene uno sull'invio delle mail
    23-08-2005: Udinese in cémpions lìg
    Questa estate l'ho passata a Tallin

  8. #8
    grazie.... anche se non so molto bene l'inglese.... ti ringrazio..

    credo di aver scoperto l'indirizzo ip di tiscali...
    non è che devo inserirlo nell'Host?

    Ciao

  9. #9
    Utente di HTML.it L'avatar di Xadoom
    Registrato dal
    Dec 2002
    Messaggi
    1,491
    I server sono gli stessi che usi quando setti i client di posta elettronia, per tiscali mi pare:
    smtp.tiscali.it (invio)
    pop3.tiscali.it (ricezione)
    Tuttavia ora mi viene il dubbio che sia tiscalinet.it e non tiscali, ma vai sul sito tiscali e controlla!
    Ciao
    Windows Xp
    [Java]
    [PHP]Notepad++
    [Fortran90-77] elf90 g77
    [C++ /WinAPI] DevC++ VisualC++

  10. #10
    il valore che mi indichi:
    smtp.tiscali.it lo devo inserire qui
    String host="yourmailhost";
    giusto?

    grazie mille... proverò sperando.........

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.