Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 23rd, 2004, 07:18 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default Smtpmail.Send Ques

Hello
I am trying to learn these things from books so please excuse my lack of proper education.

In this book that I am reading it tells me to make sure IIS Default SMTP Virtual Server is running. Then I need to go to Access -> Relay Restriction and add 127.0.0.1 as IP Address Mask so my localhost has access Granted.

I tried the book code:
Imports System.Web.Mail

Private Sub SendEmail(ByVal ToAddress As String )
        Dim msg As MailMessage
        msg.From = "[email protected]"
        msg.To = ToAddress
        msg.Subject = "Topic"
        msg.Body = "Body Message"
        SmtpMail.SmtpServer = "localhost"
        SmtpMail.Send(msg)

    End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button2.Click
              Try
 Me.SendEmail(txtEmail.Text)
Catch ex as Exception
Response.Write("Email Failed")
End Try

    End Sub


-----------------------------------------------------------
Of course this doesn't run. I get "Email Failed".

The msg.From is valid and I am getting and able to send email from that account.

What step am I missing?

Thank you.


 
Old August 23rd, 2004, 07:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Try using the IP address or the computer name instead of localhost.

 
Old August 23rd, 2004, 02:21 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello stu9820,
I tried both computer name and ip address and the smtpmail.send won't run.



 
Old August 23rd, 2004, 02:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Make sure SMTP is running :) and then try SmtpMail.SmtpServer = "127.0.0.1"

 
Old August 24th, 2004, 02:34 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SMTP is running and I already tried SmtpMail.SmtpServer = "127.0.0.1"

The only thing I didn't mention is that the server is domain controller. Will this affect smtp?????

 
Old August 24th, 2004, 07:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I don't think it would affect SMTP...
 
Old August 24th, 2004, 07:40 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Do you have a firewall?

 
Old August 24th, 2004, 10:08 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No firewall

 
Old August 24th, 2004, 10:36 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The msg.From can be any email address right? or does my IIS Default SMTP Virtual Server must have this email address configured??????

 
Old August 24th, 2004, 01:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Shouldn't be the email address....





Similar Threads
Thread Thread Starter Forum Replies Last Post
About SmtpMail.Send() Method hhkris4u ASP.NET 1.0 and 1.1 Professional 3 February 6th, 2007 04:24 AM
email without SmtpMail.Send method??? thomaz C# 3 April 1st, 2006 10:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.