472,334 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,334 software developers and data experts.

Sending emails through Asp.net

I need to send order confirmation emails through my asp.net
storefront. With my Asp 3.0 sites I use cdonts with no issues. I've
researched the system.web.mail asp.net way and haven't got it to work.
It boils down to the online smtp server declaration. I say a
solution to active relay on the mail server but in the next sentence
it said doing this may open your server up to spam relays. Not what I
want to do. I've tried using cdonts with asp.net and actually was
surprised to see it work offline while I was testing on my machine.
When I tried it online I got an exception. Any thoughts on this? I
even tried to use server.transfer("old asp3.0 email script") to
trigger the email but also received an exception.
Nov 18 '05 #1
1 1597
Mark,

Although I'm no expert on this subject I don't see how using the built in
System.Web.Mail class could ever "open up for relaying spam". The mail class
and your SMTP server has absolutely nothing to do with eachother other than
an occasional handshake whenever you are trying to send a mail.

MailMessage m = new MailMessage();
m.Subject = "Hello world";
m.From= "my*****@email.com";
m.To = "yo*******@email.com";
m.Body = "This is just a test";
SmtpMail.SmtpServer = "localhost"; //or whatever SMTP server that normally
allows you to relay (could be your ISPs)
SmtpMail.Send(m);

What happens here is simply that the Send method of SmtpMail class connects
to the specified SMTP server and sends the mail!

This is a transcript of what's going on when sending a mail:
HELO localhost //Function handshakes with SMTP-server
250 locahost Hello localhost // Server responds
mail from: my*****@email.com //function sends sender email
250 Sender OK //Server accepts
rcpt to: yo*******@email.com //function sends recipients email
250 Recipient OK. Will forward //Server accepts (OR denies!!)
data //Starting actual body and subject
subject: "Hello world"

This is just a test
. //the dot tells the smtp server that message is completed
250 Message accepted for delivery //Server accepts and sends!
I don't see any reasons why all of a sudden your SMTP server should be open
for spammers. This can only be changed by a setting inside your Mailserver,
and not by .Net itself unless you are able to code directly to your mail
server!

If anyone else has another (or better) explanation, please disregard this
one! ;)

Hope that it helps,

Thomas Regin.
"mark" <ma**@barkerspecialty.com> wrote in message
news:f3**************************@posting.google.c om... I need to send order confirmation emails through my asp.net
storefront. With my Asp 3.0 sites I use cdonts with no issues. I've
researched the system.web.mail asp.net way and haven't got it to work.
It boils down to the online smtp server declaration. I say a
solution to active relay on the mail server but in the next sentence
it said doing this may open your server up to spam relays. Not what I
want to do. I've tried using cdonts with asp.net and actually was
surprised to see it work offline while I was testing on my machine.
When I tried it online I got an exception. Any thoughts on this? I
even tried to use server.transfer("old asp3.0 email script") to
trigger the email but also received an exception.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and...
10
by: Stuart Mueller | last post by:
I have an exchange server, that I sometimes use to perform mail shots to clients on our database, these can be upwards of 1000 at a time. As we...
1
by: Ian Taylor | last post by:
Hi all... Is it possible to send RTF-formatted emails using the .NET SmtpMail implementation? I can only find provision in the BodyFormat...
3
by: VB Programmer | last post by:
My company has it's own webserver, which is going to host our ASP.NET web application. We want the website to be able to send out emails. 1. ...
2
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express...
3
by: Ant | last post by:
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...
5
by: Kun | last post by:
i have the following code: ---------------------------------- import smtplib from email.MIMEText import MIMEText fp =...
5
by: Jai | last post by:
Hi, I am in a problem of sending mass emails(newsletter) to my website members. Actually my problem is this: I want to send newsletter to...
1
by: robbiesmith79 | last post by:
Just so this is out there on the web, I battled the past 24 hours about this. Background info... I developed a ecommerce website in PHP 4 on a...
2
by: lstanikmas | last post by:
Hi, I'm validating a form with this ASP but receiving some blank email responses; does anyone see anything wrong with it?: function...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.