473,722 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send Mail Using SMTP

Max
hi

I am using System.Web.Mail .MailMessage with System.Web.Mail .SmtpMail to
send mail. now the my question is,

Is it compulsory to add fields smtpauthenticat e, sendusername and
sendpassword fields to MailMessage Object????.

mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e",
"1")
mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/sendusername",
SMTPEmail)
mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/sendpassword",
SMTPPassword)

Which fields will i have to add if my SMTP Server doesn't require
authentication.

Sep 6 '06 #1
4 2363
Is it compulsory to add fields smtpauthenticat e, sendusername and
sendpassword fields to MailMessage Object????.

mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e",
"1")
mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/sendusername",
SMTPEmail)
mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/sendpassword",
SMTPPassword)

Which fields will i have to add if my SMTP Server doesn't require
authentication.
None.
Just try once, and you will see, that the mail will be delivered...

Markus
Sep 6 '06 #2
Max
thanks

Markus wrote:
Is it compulsory to add fields smtpauthenticat e, sendusername and
sendpassword fields to MailMessage Object????.

mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e",
"1")
mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/sendusername",
SMTPEmail)
mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/sendpassword",
SMTPPassword)

Which fields will i have to add if my SMTP Server doesn't require
authentication.

None.
Just try once, and you will see, that the mail will be delivered...

Markus
Sep 6 '06 #3
You might also take a look at a post I made in response to another question
in this NG under the original posters' subject, "Send email through mapi".

Cheers!

~ Duane Phillips.

"Max" <ma***********@ gmail.comwrote in message
news:11******** *************@p 79g2000cwp.goog legroups.com...
thanks

Markus wrote:
Is it compulsory to add fields smtpauthenticat e, sendusername and
sendpassword fields to MailMessage Object????.

mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e",
"1")
mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/sendusername",
SMTPEmail)
mm.Fields.Add(" http://schemas.microso ft.com/cdo/configuration/sendpassword",
SMTPPassword)

Which fields will i have to add if my SMTP Server doesn't require
authentication.

None.
Just try once, and you will see, that the mail will be delivered...

Markus

Sep 6 '06 #4
BTW, ... it was sent 9/6/2006... sorry...

I'll just repost the answer here...

'xxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xx
'SMTP EMAIL NOTES
'As condensed from: http://www.systemwebmail.com/default.aspx
'1. Have a reference set to the System.Web.dll.
'2. Have "Imports System.Web.Mail " statement at the top of your code.
'3. SmtpMail.SmtpSe rver must allow relaying for FROM email address or your
IP address,
' or you must use dotNET 1.1 or higher to authenticate.
'SAMPLE SETTINGS
'Dim emlEmail As New System.Web.Mail .MailMessage()
' NOTE: all email addresses can be like: "my******** @my-domain.com" - OR -
Fully named like: """John Smith"" <my********@m y-domain.com>"
' Also, multiple email addresses can be sent separated by semi-colon
character.
'emlEmail.To = "my******** @my-domain.com"
'emlEmail.From = "my******** @my-domain.com"
'emlEmail.Cc = "my******** @my-domain.com" 'optional
'emlEmail.Bcc = "my******** @my-domain.com" 'optional
'emlEmail.Subje ct = "SUBJECT_HE RE"
'emlEmail.BodyF ormat = MailFormat.Html
'emlEmail.Body = "BODY OF THE MESSAGE HERE"
'emlEmail.Heade rs.Add("Reply-To", "my******** @my-domain.com")
'Attachments()
'Dim attachment As New System.Web.Mail .MailAttachment ("C:\Foo.xls ") 'create
the attachment
'emlEmail.Attac hments.Add(atta chment) 'add the attachment
'Authentication cannot be done using the .NET Framework 1.0. Must use 1.1 or
higher.
'emlEmail.Field s.Add("http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e",
"1") 'basic authentication
'emlEmail.Field s.Add("http://schemas.microso ft.com/cdo/configuration/sendusername",
"my_username_he re") 'set your username here
'emlEmail.Field s.Add("http://schemas.microso ft.com/cdo/configuration/sendpassword",
"super_secr et") 'set your password here
'SmtpMail.SmtpS erver = "EMAIL_SERVER_D OMAIN" 'your real server goes here
'SmtpMail.Send( emlEmail)
'xxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xx

Watch for text wrapping...

Please note that the above example is for DotNet 1.x
http://www.systemwebmail.com/

To see more information for 2.x, see http://www.systemnetmail.com/

I have found these two sites very useful.

HTH.

Cheers!

~ Duane Phillips.
"Duane Phillips" <du************ @askme.askmewro te in message
news:Kv******** *************** *******@giganew s.com...
You might also take a look at a post I made in response to another
question in this NG under the original posters' subject, "Send email
through mapi".

Cheers!

~ Duane Phillips.

"Max" <ma***********@ gmail.comwrote in message
news:11******** *************@p 79g2000cwp.goog legroups.com...
>thanks

Markus wrote:
>Is it compulsory to add fields smtpauthenticat e, sendusername and
sendpassword fields to MailMessage Object????.

mm.Fields.Add( "http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e",
"1")
mm.Fields.Add( "http://schemas.microso ft.com/cdo/configuration/sendusername",
SMTPEmail)
mm.Fields.Add( "http://schemas.microso ft.com/cdo/configuration/sendpassword",
SMTPPassword )

Which fields will i have to add if my SMTP Server doesn't require
authentication .

None.
Just try once, and you will see, that the mail will be delivered...

Markus


Sep 6 '06 #5

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

Similar topics

4
3094
by: Tom Petersen | last post by:
Ok, I'm 99.9999999999999999999% sure there haven't been any code changes, since the date stamps of the code are older than any email 'failures' The email piece quit working using the mail.send. If there haven't been any changes made to previously working code, where do I look for the problem now? I restarted the SMTPservice in IIS. Our real email is hosted remotely, I checked with the admin and she said no changes were made, i.e., not...
6
3257
by: John J. Hughes II | last post by:
I have a service that needs to send e-mail alerts. I have been attempting to use the System.Net.Mail function from .NET but this seems to require the IIS be installed and running. Since some of my customers are not really happy with having the IIS installed, not being used except to send e-mail this is becoming a problem. I have also tried using a little program from code project for sending e-mail which works great on older servers...
9
4306
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5, VisualStudio2002, VB as programing language. Our test/development version of the web app as hosted on our "localhost" works fine; our "Default SMTP Virtual Server" is running (per the IIS console).
5
8795
by: Andreas | last post by:
I am working with three computers, my developing computer, a Web Server and a Mail Server (Exchange). I am trying to send a email from the Web Server via the Mail Server to a valid email address with this code: MailMessage msgMail = new MailMessage(); msgMail.To = "test@address.com"; msgMail.From = "from@address.com"; msgMail.Subject = "Mail Example Subject";
3
3036
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it identifies itself as the computer name which is not in domain.com format, triggering spam filter problems). Instead, I want to have my code send through an SMTP server of a company that we pay for mail service. But they require a username and password....
14
9138
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my local default SMTP Server and my from address is a valid Yahoo/Hotmail address. I have configures the local SMTP Server to allow the IP Address 127.0.0.1.
4
7681
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
I have a web page that at the click of a button must send a bunch (1000+) emails. Each email is sent individually. I have the code working fine, using Mail Message classes and smtp and all that. But sometimes even when I'm just sending one e-mail the web page takes a minutes or so to post. Can anyone tell me why it is so slow, or how to fix the problem? To address this I am thinking of just creating a queue table to write the emails...
7
7738
by: oopsbabies | last post by:
Hello everyone, I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My machine is using Windows XP 2002 professional edition which comes with a Windows firewall. I am using McAfee free edition for anti-virus. I use an ISP provider from my country and according to them I do not need to perform authentication while sending mails through their SMTP address. Thus I am using external SMTP server. I don't have IIS installed...
8
7284
by: shapper | last post by:
Hello, I am trying to send an email using Asp.Net 2.0. I am getting the following error: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such user here at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify,
7
22871
by: Rob Dob | last post by:
The following code is giving me a timeout problem., no matter what I do I can't send a piece of mail using .net2.0 System.Net.Mail.SmtpClient via port 465 and using ssl, if however I try using outlook or outlook express it works fine.. System.Net.Mail.MailMessage msgMail = new System.Net.Mail.MailMessage("myemail@mydomain.com", "testemail@mydomain.com", "subject", "message body");
0
8863
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9238
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9157
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4502
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2602
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.