Forums Register Login

smpt java mail woes

+Pie Number of slices to send: Send
I am having problems with getting through my ISP smtp server.

I can connect using the parameters I am using in code on a telnet session no problem , but with the following code
I get a error 501 syntax HELO hostname
for the life of me. I cant see the problem
nor can I find out from telus what hostname they are being sent
so I am stuck

can others help?
peter richards

here's the telnet session - the names have been changed to protect the innocent

220 priv-edmwaa05.telusplanet.net ESMTP
HELO a5a9999@telus.net
250 priv-edmwaa05.telusplanet.net
mail from:a5a9999@telus.net
250 Ok
RCPT to: test1@telus.net
250 Ok
data
subject: test message
jlhgjhgljhgljkgljk
.
250 Ok: queued as 52MKTWBNCA
quit


here's the code

package jFudge;

import java.io.*;
import java.util.*;
import javax.mail.*;
import javax.mail.event.*;
import javax.mail.internet.*;

public final class newMailerBean extends Object implements Serializable {

/* Bean Properties */

private String from = "test@telus.net";
private String to = "test1@telus.net";
private String subject = "info";

public static Properties props = null;
public static Session session = null;

static {
/* Setting Properties for STMP host */
props = System.getProperties();
props.put("mail.smtp.host", "smtp.telus.net");
props.put("mail.smtp.auth", "true");
session = Session.getDefaultInstance(props, null);
}
/* Setter Methods */
public void setTo(String to) {
this.to = to;
}

public void setFrom(String from) {
this.from = from;
}

public void setSubject(String subject) {
this.subject = subject;
}
String messagebody = "mmmmmmmmmmmmmmmmmmm";
public void setMessage(String messagebody) {
this.message = message;
}
/* Sends Email */
public void sendMail() throws Exception {

MimeMessage message = new MimeMessage(session);
message.setRecipient(Message.RecipientType.TO,
new InternetAddress(this.to));
message.setFrom(new InternetAddress(this.from));
message.setSubject(this.subject);
message.setText(messagebody);
Transport transport = session.getTransport("smtp");
transport.connect("smtp.telus.net","a5a9999","myPassword");
message.saveChanges();
transport.sendMessage(message, message.getAllRecipients());
transport.close();

}
+Pie Number of slices to send: Send
Start by including in your property-setting section this:Then you will see the entire conversation between your code and the server appear on your console. That should give you something to tell the nice support people at Telus.
+Pie Number of slices to send: Send
thanks for the code. indded it does display the handshake converstaion. However, I solved the problem another way. I installed a local smtp server on one of the computers in the pool and we write to that and the local smtp server then sends the email to the correct destination. ( why it is not blocked at my ISP, I don't quite understand ) but then that's computers for you.
peter richards
+Pie Number of slices to send: Send
Hi,
can you tell me which SMTP server you have.I downloaded freesmtp server but look like it is having someproblem since it will always say that invalid receipient I amn't sure why...I am connected to net using SBC Yahoo DSL.I amnot sure if they would do something about my local freesmtp server.I use localhost as the name of SMTP server..it is connected as i have put it ondebug but the problem is with the 504....invalid reciepeint..
Appreciate any help

THnks
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1401 times.
Similar Threads
problems running the program
JavaMail help
Sending email from java. Pls Help!!!
how to detect a firewall
Sending an email in JSP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:15:38.