473,516 Members | 3,456 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

smtpserver

I have an email function in a vb.net client application that I’m having
trouble with.

Instead of using the smtpserver that I assign it, it insists on using the
local smtpserver. If I stop the local smtpserver, it will wait until I turn
it back on. It does this even when I run the application from a network
location.

I have tried assigning the remote smtpserver through both: smtpserver =
“smtpservername” and smtpserver.insert(0,”smtpservername”).

The from and to seem to be all right, as the process runs successfully thru
the local smtpserver. I have tried different domain values for both from and
to addresses.

try/catch is not catching an error.

Dim email As New System.Web.Mail.MailMessage
email.To = LCase(strTo)
email.From = LCase(strFrom)
email.Subject = Trim(strSubject)
email.Body = Trim(strBody)

Try
System.Web.Mail.SmtpMail.SmtpServer.Insert(0,
"smtpservernamehere")
System.Web.Mail.SmtpMail.Send(email)
Catch ex As Exception
‘ error processing here, displays error and innerexception
End Try

I could really use some help here.

thanks.
Sep 2 '05 #1
3 3110
Hi,

Use some smtp client what sends messages without local smtpserver or what
delivers messages directly.

There are lots of such components for free.

you can try: http://www.lumisoft.ee/lswww/downloa...oads/Examples/
"David" <Da***@discussions.microsoft.com> wrote in message
news:17**********************************@microsof t.com...
I have an email function in a vb.net client application that I'm having
trouble with.

Instead of using the smtpserver that I assign it, it insists on using the
local smtpserver. If I stop the local smtpserver, it will wait until I
turn
it back on. It does this even when I run the application from a network
location.

I have tried assigning the remote smtpserver through both: smtpserver =
"smtpservername" and smtpserver.insert(0,"smtpservername").

The from and to seem to be all right, as the process runs successfully
thru
the local smtpserver. I have tried different domain values for both from
and
to addresses.

try/catch is not catching an error.

Dim email As New System.Web.Mail.MailMessage
email.To = LCase(strTo)
email.From = LCase(strFrom)
email.Subject = Trim(strSubject)
email.Body = Trim(strBody)

Try
System.Web.Mail.SmtpMail.SmtpServer.Insert(0,
"smtpservernamehere")
System.Web.Mail.SmtpMail.Send(email)
Catch ex As Exception
' error processing here, displays error and innerexception
End Try

I could really use some help here.

thanks.

Sep 4 '05 #2
Did you try:

SmtpMail.SmtpServer = <your server name or IP address>

http://msdn.microsoft.com/library/de...ervertopic.asp

I don't know where you got the .Insert method from...it's not documented
on MSDN.

David wrote:
I have an email function in a vb.net client application that I’m having
trouble with.

Instead of using the smtpserver that I assign it, it insists on using the
local smtpserver. If I stop the local smtpserver, it will wait until I turn
it back on. It does this even when I run the application from a network
location.

I have tried assigning the remote smtpserver through both: smtpserver =
“smtpservername” and smtpserver.insert(0,”smtpservername”).

The from and to seem to be all right, as the process runs successfully thru
the local smtpserver. I have tried different domain values for both from and
to addresses.

try/catch is not catching an error.

Dim email As New System.Web.Mail.MailMessage
email.To = LCase(strTo)
email.From = LCase(strFrom)
email.Subject = Trim(strSubject)
email.Body = Trim(strBody)

Try
System.Web.Mail.SmtpMail.SmtpServer.Insert(0,
"smtpservernamehere")
System.Web.Mail.SmtpMail.Send(email)
Catch ex As Exception
‘ error processing here, displays error and innerexception
End Try

I could really use some help here.

thanks.

Sep 4 '05 #3
An Example that works fine:

sTo = de**************@destination.com

sFrom = "in*******@fake.com";

sSubject = "Fake Reminder";

sBody = "";

sAttach = "";

sCc = "";

sBcc = "";

sBodyFormat = "HTML";

sBodyEncoding = Encoding.ASCII.EncodingName;

sPriority = "Normal";

sUrlContentBase = "http://www.fake.com";

sUrlContentLocation = "http://www.fake.com";

sMailServer = "smtp1.yourMailServerProvider.ca";

SmtpMail.SmtpServer = sMailServer;

SmtpMail.Send(MyMail);

1) You can set HTML or Plain Text
2) Do not foget to add the following namespaces:

System.Web.Mail
System.Text

Hope this helps.

Marc./Toronto/Canada

----------------------
Marc. B.,BSc, MSc, BEd
Senior Software Engineer
Alliance Information Technology
www.alliance-technology.com
Herzing College - Section Head
Internet Solution Developer Program
"David" <Da***@discussions.microsoft.com> wrote in message
news:17**********************************@microsof t.com...
I have an email function in a vb.net client application that I'm having
trouble with.

Instead of using the smtpserver that I assign it, it insists on using the
local smtpserver. If I stop the local smtpserver, it will wait until I
turn
it back on. It does this even when I run the application from a network
location.

I have tried assigning the remote smtpserver through both: smtpserver =
"smtpservername" and smtpserver.insert(0,"smtpservername").

The from and to seem to be all right, as the process runs successfully
thru
the local smtpserver. I have tried different domain values for both from
and
to addresses.

try/catch is not catching an error.

Dim email As New System.Web.Mail.MailMessage
email.To = LCase(strTo)
email.From = LCase(strFrom)
email.Subject = Trim(strSubject)
email.Body = Trim(strBody)

Try
System.Web.Mail.SmtpMail.SmtpServer.Insert(0,
"smtpservernamehere")
System.Web.Mail.SmtpMail.Send(email)
Catch ex As Exception
' error processing here, displays error and innerexception
End Try

I could really use some help here.

thanks.

Sep 5 '05 #4

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

Similar topics

7
4018
by: sampsons | last post by:
Greetings, I am using Web.Mail.Mailmessage along with Web.Mail.SmtpMail.Send(MailMessage) method Now, this sends Email using the Default SMTP server of my REMOTE HOST. Sadly I have found that many ISP's block mail sent through this method. I do have an SMTP server included in the Remote Hosting package, but that SmtpServer requires...
1
1753
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 domains the mails are not sent. What should i do for the sending mails to hotmail and other accounts. (But if i have send mails to hotmail from my...
0
1085
by: Michael Appelmans | last post by:
The SMTP server I'm trying to use requires me to pass user id and password when sending email. Does anyone know how I can set this in the SmtpMail class (c#)? Thanks for any suggestions. Michael
3
1300
by: Bob Cummings | last post by:
Greetings I hope this is the correct newsgroup. I am working on a senior project for school. One of the requirement is to have the functionality of send email reminders from our web application. No problem we thought. We set the value of smtpserver in the web.config file. That way we could develop on campus and when we went out to the...
0
1608
by: EO | last post by:
Could someone help me understand why the following seems to be an effective band-aid for CDO object errors? smtpmail.smtpserver.insert(0,"localhost") Looking at the documentation on smtpmail.smtpserver at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebmailsmtpmailclasssmtpservertopic.asp there is...
1
939
by: SirPyros | last post by:
I am creating a mass mailer web app. I was wondering if there was a big performance difference between adding all of the email addresses to the mailmessage Bcc property or simply sending a new mail message for each recipient. The reason I ask if because I want to be able to add a link with the Recipient ID as a query string parameter for...
1
4164
by: Volker Jobst | last post by:
Hi, The following code works fine as long as I don't use a smtp-server which requires authentication: Sub sendMail() Dim sfrom As String = TextBox1.Text Dim sto As String = TextBox2.Text Dim ssubject As String = TextBox3.Text Dim sbody As String = RichTextBox1.Text
3
358
by: David | last post by:
I have an email function in a vb.net client application that I’m having trouble with. Instead of using the smtpserver that I assign it, it insists on using the local smtpserver. If I stop the local smtpserver, it will wait until I turn it back on. It does this even when I run the application from a network location. I have tried...
2
4681
by: destiple | last post by:
I'm having issues with an aspx script. It is rejecting any submissions from people with gmail accounts. Could this be because the smtp server it is trying to use doesn't exists or allow outgoing mail? My smtp server (smtpout.secureserver.net) requires authentication. What can I do about this? My script is below:
0
7273
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, well explore What is ONU, What Is Router, ONU & Routers main...
0
7405
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7547
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5712
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5106
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...
0
3252
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1620
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
1
823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
487
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...

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.