Cannot send email

View: New views
3 Messages — Rating Filter:   Alert me  

Cannot send email

by Nico Robin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I got major problem here

i'm using smtp as transport protocol

my mail server would be mail.mydomain.com
i can send email inside my domain (e.g shasha@mydomain.com)
but i cannot send email outside that domain (e.g shasha@gmail.com or shasha@yahoo.com)

and always get the following error

class com.sun.mail.smtp.SMTPAddressFailedException: 553 sorry, that domain isn't in my list of allowed rcpthosts

can you help me fix this ?

Thanks

Re: Cannot send email

by Roman Puchkovskiy-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi.

I'm not an expert in smtp+java at all, but looks like you have to have
an SMTP AUTH. Please look here:
http://forums.serverbeach.com/archive/index.php/t-3339.html
(just one of links Google found).

Nico Robin writes:

> Hi,
> I got major problem here
>
> i'm using smtp as transport protocol
>
> my mail server would be mail.mydomain.com
> i can send email inside my domain (e.g shasha@...)
> but i cannot send email outside that domain (e.g shasha@... or
> shasha@...)
>
> and always get the following error
>
> class com.sun.mail.smtp.SMTPAddressFailedException: 553 sorry, that domain
> isn't in my list of allowed rcpthosts
>
> can you help me fix this ?
>
> Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Cannot send email

by Nico Robin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

turn out to be that to use authentication in java mail you have to explicitly give the user and password to the Java Mail

here's what i do

I edit MailEngine.java and add these lines of code in send method


JavaMailSenderImpl mailSendImpl = (JavaMailSenderImpl) this.mailSender;
               
        mailSendImpl.setPassword(pwd);
                mailSendImpl.setUsername(user);
                mailSendImpl.setProtocol(prtcl);
                mailSendImpl.setJavaMailProperties(properties);
                mailSendImpl.send(msg);

you can get the parameter from the properties given by the session in mailSession bean therefor i also edit the applicationContext-service.xml so that the mailSession bean is injected to the MailEngine so that we can access it

hopes it help with others dealing with the same problem as mine

thanks :)




Hi.

I'm not an expert in smtp+java at all, but looks like you have to have
an SMTP AUTH. Please look here:
http://forums.serverbeach.com/archive/index.php/t-3339.html
(just one of links Google found).