Why am I unable to use the SENDMAIL function in MATLAB to send emails to addresses outside my domain?

8 visualizaciones (últimos 30 días)
I have set my SMTP Server and Email address as follows
setpref('Internet','SMTP_Server','myserver.com');
setpref('Internet','E_mail','me@aserver.com');
However, when I execute the SENDMAIL command
sendmail('me@hotmail.com','Test email', 'Test');
I receive the following error
??? Error using ==> sendmail>sendSMTP
SMTP error: 550 5.7.1 Unable to relay for me@hotmail.com
Error in ==> sendmail at 144
sendSMTP(out, in, ['RCPT TO: ' to], 1);

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 27 de Jun. de 2009
The error message you receive is due to the SMTP server name and the email address not belonging to the same domain.
Thus, the domain 'myserver.com' will prevent someone outside that domain, for example 'me@aserver.com', from sending e-mails. Email servers are typically set up this way in order to prevent e-mails from spammers.
In order to be able to successfully use the SENDMAIL command, ensure that the SMTP Server and email address belong to the same domain. For example
setpref('Internet','SMTP_Server','myserver.com');
setpref('Internet','E_mail','me@myserver.com');

Más respuestas (0)

Etiquetas

Aún no se han introducido etiquetas.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by