Sending email (ASP.NET 2.0)

J

Jack

Hi,

I am still new to .NET so, i'm sorry if my question is a bit too simple :)

I would like to know what is the "best-practice-way" of sending email from
asp.net (VbScript). I want to make a "contact us" page for my website.

Tnx.
 
J

Jack

PS:
I alreay have <mailSettings> configured in web.config. I would like to use
these settings to send mail instead of defining smtp server and credentials
in aspx or source page:

<mailSettings>
<smtp [email protected]>
<network host="smtp.mydomain.com" password="password"
userName="username" />
</smtp>
</mailSettings>
 
J

Jack

Hi Peter,

Yes, its correct. Sorry for the mistake, just trying to upgrade myself from
classic asp to .net :)

I have found solution to my problem.

Rgds.
 
C

Cowboy \(Gregory A. Beamer\)

You are missing the deliveryMethod attribute on the smtp tag. This can be
set to network, pickupDirectoryFromIis and specifiedPickupDirectory (which
you would have to state). In general, you will use network here. I am not
completely sure this is mandatory, but I always include it in my config.

The next thing to check is to ensure your smtp server/service allows you to
use it from this server. Since you are not using the local SMTP server, you
could have restrictions on the server you are using that does not allow you
to send messages through here.

In fact, if you are literally using (e-mail address removed) as your address, it is
likely you are being restricted as most servers will automatically filter
out messages from other domains. I would assume you are just using this as a
marker, so I will not go into too much detail. Just make sure the SMTP
server and the address are the same domain or have a network admin allow
from the other domain.

I personally prefer sending directly through our corporate exchange server,
but this may not be an option you have. It is really no different than SMTP,
as far as setup, but I have more troubleshooting ability.

With your SMTP server, you can examine the dump box (bad email box) and see
if your messages are getting stuck in there. If so, you have a configuration
problem on the SMTP server end. If, instead, you are receiving an error in
your code, you should post it.
 
J

JoeP

Hi All,

Need to check if the propery of an object exits.

oMyObject.Message

In some cases the Message property may not exists. I know the GetType() can
do it.
How would you check it?

Thanks,

Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top