473,387 Members | 1,700 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,387 software developers and data experts.

Do we need IIS for sending mails from an Vb.Net applications

Hi to every one,
I am having a problem while sending mail from my application. iI want to send mail from my Vb.Net applications. and it is working fine in my system, but the problem is that when i try to run tha same application from another system where there is no iis installed, its giving me error mail not sent, and when i change the DeliveryMethod to network , giving me tha same problem...
So can anyone help me out with this problem..
The code is as below.
Public pInPassword As String
Public pOutMailId As String
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Try
'err msg = Request for the permission of type 'System.net.mail.smtpPermission, system, Version=2.0.0.0, Culture=neutral, PublicKey token= b77a5c561934e089' failed
Dim msg As System.Net.Mail.MailMessage
Dim objSmtp As New System.Net.Mail.SmtpClient("65.175.81.34")
msg = New System.Net.Mail.MailMessage(txtFrom.Text, txtTo.Text, txtSub.Text, txtBody.Text)
msg.IsBodyHtml = True
If check() = True Then
objSmtp.Credentials = New System.Net.NetworkCredential(txtFrom.Text, txtPassword.Text, "65.175.81.34")
objSmtp.DeliveryMethod = SmtpDeliveryMethod.SmtpDeliveryMethod.Network
objSmtp.Send(msg)
MessageBox.Show("Mail Sent Successfully....")
ClearForm()
End If

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try


Thank you in advance.
Deepak
May 16 '07 #1
5 3623
dip_developer
648 Expert 512MB
Hi to every one,
I am having a problem while sending mail from my application. iI want to send mail from my Vb.Net applications. and it is working fine in my system, but the problem is that when i try to run tha same application from another system where there is no iis installed, its giving me error mail not sent, and when i change the DeliveryMethod to network , giving me tha same problem...
So can anyone help me out with this problem..
The code is as below.
Public pInPassword As String
Public pOutMailId As String
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Try
'err msg = Request for the permission of type 'System.net.mail.smtpPermission, system, Version=2.0.0.0, Culture=neutral, PublicKey token= b77a5c561934e089' failed
Dim msg As System.Net.Mail.MailMessage
Dim objSmtp As New System.Net.Mail.SmtpClient("65.175.81.34")
msg = New System.Net.Mail.MailMessage(txtFrom.Text, txtTo.Text, txtSub.Text, txtBody.Text)
msg.IsBodyHtml = True
If check() = True Then
objSmtp.Credentials = New System.Net.NetworkCredential(txtFrom.Text, txtPassword.Text, "65.175.81.34")
objSmtp.DeliveryMethod = SmtpDeliveryMethod.SmtpDeliveryMethod.Network
objSmtp.Send(msg)
MessageBox.Show("Mail Sent Successfully....")
ClearForm()
End If

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try


Thank you in advance.
Deepak
check Whether SMTP mail server is configured on that particular machine or not...
May 16 '07 #2
check Whether SMTP mail server is configured on that particular machine or not...
Hi dip_developer,
I asked my system Admin, and he said that smtp server is configured in server itself and he has given my the same Ip address of the smtp server so no need to configure the server..
Can you tell me what else i have to check?
this problem is really making me crazy.
thanks.
May 16 '07 #3
dip_developer
648 Expert 512MB
Look at this

SMTP Server Set up
May 16 '07 #4
Look at this

SMTP Server Set up
SO without IIS i wont be able to send mail's isnt it?.
il try to install IIs and check my application.
Then all clients using this windows application must have IIS?
Thanks
May 16 '07 #5
SO without IIS i wont be able to send mail's isnt it?.
il try to install IIs and check my application.
Then all clients using this windows application must have IIS?
Thanks
hi dip_developer
My problem got solved....
Actually that machine dint had default gateway... and when i configured the gateway its working now...
Thanks...
May 16 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Good Man | last post by:
Hi I'm building a 'job posting' site of sorts. When a job is available in a particular state, I want the system to send an email to everyone who is 'watching' that state. I know how to do...
1
by: Jayakumar | last post by:
HI, I am using System.web.mail class in my application to send mails. I am using SMTP server for the same. I can send mail to the intranet addresses, But when i send mails to Hotmail or other...
7
by: Lau | last post by:
I need to send 1000 emails from an asp.net website. Normally I would use System.Web.Mail.MailMessage() to send thru an SMTP server. But the large amount of emails results in a timeout. My server...
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...
1
by: Dirk Goossens | last post by:
Hello! I'm sending E-mails to mailadresses in a table, using the code below. How can I send more than one attachment? Access can find the file to be send in this field: MY_EMAILATTACHMENT_FIELD...
8
by: Michel Posseth [MCP] | last post by:
Hi does someone has experience with this ?? i have made a lot of apps in the past that were capable of sending e-mails the server i then talked to was a Linux SMTP server and it worked great ...
3
by: dskinibbyb | last post by:
Hi Everybody, I am sending mail using the new class in .Net 2.0. Here while sending internal mails it is giving me problem. Carriage return, Line feed and Spaces are lost while sending mails....
2
by: srinivaspnv21 | last post by:
hi every one, plz help me out, i have to send mails from my asp.net page.... I have tried a code where mails are going only to gmail users the code is ... namespace: using System.Web.Mail;...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.