473,388 Members | 1,552 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 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 1668
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 confirmed that these emails work in yahoo.com's...
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 don't want different clients to see who we are...
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 property of the message to send plain text or HTML...
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. What do I need on the server so that it has the...
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 configuration, because when receiving emails from friends -...
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 2003 server. The simplest way to use this is...
5
by: Kun | last post by:
i have the following code: ---------------------------------- import smtplib from email.MIMEText import MIMEText fp = open('confirmation.txt', 'rb') msg = MIMEText(fp.read()) From =...
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 my website members. But I had given a facility for...
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 shared linux hosting plan from GoDaddy and had the...
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 isFormVarExcluded(thisForm, strToCheck) { var strExcludeVars...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.