473,465 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Create 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 3102
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
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...
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...
0
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. ...
3
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...
0
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...
1
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...
1
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...
3
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...
2
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...
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...
1
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...
0
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.