Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending email...

Status
Not open for further replies.

bclt

Programmer
Mar 13, 2005
363
GR
This code is in a button:

Code:
   Dim msg As New Web.Mail.MailMessage

   'Web.Mail.SmtpMail.SmtpServer = my IP ???
   msg.From = txtFrom.Text
   msg.To = txtTo.Text
   msg.Subject = txtSubject.Text
   msg.Body = txtBody.Text
   msg.BodyFormat = Web.Mail.MailFormat.Text

   Web.Mail.SmtpMail.Send(msg)

   MsgBox("Message Sent")

Although no error appears the message is not sent.
If i remove the " ' " at smptserver and fill it with my IP (xxx.x.x.x) Error occurs.

Something's wrong here..
Tnx
 
err, do you have an SMTP server running on your machine?

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
I think nope. This is quite similar to outlook, just want to send email.
 
Is there an SMTP server on your network?

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Tried "mailgate.otenet.gr" and Worked !!!

 
yup, it helps when you specify a valid SMTP server.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
I should add label "SMTP Server" and a textbox also, in case this simple app is run by an other user ?

I think that if i don't specify SMTP Server it gets it by default.... but when tried this (making it a commeent) my msgbox appears "Message sent" with no error. The email never arrives my the inbox ...

So it hasn't got it by default
 
The "default" will be your localhost and since you don't have an SMTP server installed on your machine you won't get the email!

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
HI
My problem is that my machine is behind an ISA server ...so i need to know how to activate the smtp service through ISA server

i tried assigning
Web.Mail.SmtpMail.SmtpServer = "12.12.12.3" 'ISA IP'

but it`s always the CDO error...

so do I write code for local host server"MY MACHINE" and try to enable my local server using ISA?how?
OR
do i refer to ISA server in my code ?! what can i do ?
karim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top