"john" <jfl...@webdatabases.co.uk> wrote in message
news:8visu0$t...@bornews.inprise.com...
> I'm having a problem sending mail through exchange using tidsmtp and
> tidmessage.
>
> If I include the recipient as an account on the exchange server (an
external
> email address to the company) then the mail gets delivered.
>
> However if the external email address does not exist as an account on the
> mail server then it bounces back saying undeliverable.
>
> The program works fine from another location where there's no exchange
> server.
>
> Can anybody give me any pointers to a solution.
>
> The raw code is something like this
>
> MySmpt1.Host := 'mail.myhost.com';
> try
> MySmpt1.Connect;
> except
>
> end;
> MyMessage1.Recipients.Clear;
> MyMessage1.Recipients.EMailAddresses :=
> EmailListQEmailAddress.Value;
> MyMessage1.From.Address := 'jo...@myhost.com';
> MyMessage1.Subject := edtSubJect.Text;
> MySmpt1.Send(MyMessage1);
> end;
> MessageDlg('Email Run Finished',mtinformation, [mbok], 0);
> MySmpt1.DisConnect;
>
>
Is the Exchange server in someone elses network? It sounds like you are
unfamiliar with spammers modus operandi:
The in the good ol' pre-spam days, remote mail servers didn't mind sending your
messages along. But spammers started sending messages to remote hosts with
1000's of recipients listed in the header. So the remote hosts would then
forward copies of the original email to each recipient, using up your clock
cycles and bandwidth.
So, modern mail systems allow limits on who can send and to whom: basically, if
you are a local, then you can send to anyone internal or external, but if you
are remote then only to locals. This stops spammers from using your server as a
mail "expander." Ideally all mail servers would do this. Spammers are
constantly scanning for unprotected servers - if you set one up it won't be too
long before your mail server will be offering a lot of fantastic porn, fantastic
business opportunities, etc on someone else's behalf.
So your "undeliverable" response, indicates that the remote sever is refusing to
relay your message, and for a good reason.
Jim