Sending Email

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send
mail, however it's not sending any emails.

I'm using it on a Windows 2003 server.

The simplest way to use this is
smtpMail.Send("(e-mail address removed)", (e-mail address removed), "Message subject", "Message
Body")

I'm sending it to my own email address on a different server using a dummy
'from' email.

Does anybody have any experience with this. It sems simple enough...
Much thanks in advance
Ant
 
Hi,

Did you set the SMTP server properly? And does that server allow
relaying for your other address?

Also, when you mean it is not sending emails, do you mean it throws an
exception, or it executes ok, but no email is sent?

-Lenard
 
Hi Lenard,
No exceptions occur, just nothing comes into my email box. I now suspect
that it is being filtered by the corporate spam filter as I tried sending
another message via a 'real' email service & again I got nothing.

I am interested in your question:
Did you set the SMTP server properly? And does that server allow
relaying for your other address?

I didn't set this dev box up so are you suggesting that the server may be
incapable of sending emails? If so, are the settings in smpt IIS?

Thanks for your help
Ant
 
Hi,

I meant did you use SmtpMail.SmtpServer to specify which SMTP server you
want to use for mailing?

And the other question was directed at, if you know that this server
will let you relay mail for other addresses? Corporate email servers
often deny relaying, so you would not be able to use any address in the
to/from fields.

For testing applications that mail something I found the best way to be
installing the IIS SMTP server component locally (it is present in XP
and Server versions of Windows). Then you can allow yourself all rights
(localhost), and you can set it to send your mails directly (no
smarthost). This way (theoretically) no spam filter will catch it (at
least on the inside) and it will relay wherever you want to relay.

-Lenard
 
Back
Top