Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 30th, 2008, 08:25 AM
Authorized User
 
Join Date: Jul 2008
Location: Cape Town, Western Cape, South Africa.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Smtp

I'm trying to send user credentials via an e-mail to new user who singed up, but it cannot resolve remote name.Please help i don't understand i'm using university's computer i don't even know their smtp domain name. Please anyone,please help.This is beyond my brains and im just a student please guys help. Im using an Appointment booking system from instant results book.

<system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="appointment@tut.ac.za">
        <network defaultCredentials="true" host="localhost" port="25" />
      </smtp>
    </mailSettings>
  </system.net>

supertedz
__________________
supertedz
Reply With Quote
  #2 (permalink)  
Old October 30th, 2008, 11:12 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi there.. don't start a new thread, when someone think something about your problem it will tell you.

I never had problems sending mails, but if you don't know the SMTP name, how do you expect to send it??

where's the code you use to send the mail?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
Reply With Quote
  #3 (permalink)  
Old November 1st, 2008, 12:46 AM
Authorized User
 
Join Date: Jul 2008
Location: Cape Town, Western Cape, South Africa.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi there Gonzalo this is my improved question. I think it is clear now what im trying to say thanks for the respond.

my problem is only within this code: It says it cannot resolve the remote name:'teddy@tut.ac.za'

<system.net>
    <mailSettings>
      <smtp deliveryMethod="Network">
        <network host="teddy@tut.ac.za" />
      </smtp>
    </mailSettings>
  </system.net>

supertedz
Reply With Quote
  #4 (permalink)  
Old November 1st, 2008, 12:50 AM
Authorized User
 
Join Date: Jul 2008
Location: Cape Town, Western Cape, South Africa.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

here's the code:

 Protected Sub CreateUserWizard1_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs) Handles CreateUserWizard1.SendingMail
    ' Customize the mail body by replacing the placeholders in the static mail body file with actual values.
    e.Message.Body = e.Message.Body.Replace("##Id##", Membership.GetUser(CreateUserWizard1.UserName).Pro viderUserKey.ToString())
    e.Message.Body = e.Message.Body.Replace("##UserName##", CreateUserWizard1.UserName)

        Dim applicationFolder As String = Request.ServerVariables.Get("SCRIPT_NAME").Substri ng(0, Request.ServerVariables.Get("SCRIPT_NAME").LastInd exOf("/"))
        e.Message.Body = e.Message.Body.Replace("##FullRootUrl##", Helpers.GetCurrentServerRoot & applicationFolder)
  End Sub

supertedz
Reply With Quote
  #5 (permalink)  
Old November 1st, 2008, 12:25 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Well.. that's the name of the host for your network?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
Reply With Quote
  #6 (permalink)  
Old November 1st, 2008, 03:46 PM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

If this is related to the book ASP.NET 2.0 - Instant Results, you would have been better off posting this in the book's own forum: http://p2p.wrox.com/forum.asp?FORUM_ID=249

Anyway, you probably need to talk to your network administrator to get the right information like the SMTP server name. Maybe they don't allow you to use their SMTP server remotely, maybe you need to pass in credentials before you are allowed to use them; maybe the server is only accessible from within a specific network (range). We can't answer these kind of questions for you; only the system administrator will be able to answer them for you.

In web.config you need to define the mail server, not the address. So, anything with an @ in it will fail. The config element looks like this:
Code:
<system.net>
<mailSettings>
  <smtp>
    <network host="YourHost"/>
  </smtp>
</mailSettings>
</system.net>
If you need to pass a user name and password, try this:
Code:
<system.net>
<mailSettings>
  <smtp>
    <network host="YourHost" userName="UserName" password="Password"/>
  </smtp>
</mailSettings>
</system.net>
Hope this helps,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with SMTP asf_fmi BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 January 20th, 2007 01:32 AM
Help on C#/SMTP peri C# 2 December 6th, 2004 10:43 PM
Find Name OF SMTP qadeerahmad General .NET 3 November 24th, 2004 09:20 AM
About SMTP abdul_owiusa C# 2 August 6th, 2004 06:12 AM
SMTP for mail() petercch Pro PHP 1 July 25th, 2003 06:53 PM



All times are GMT -4. The time now is 05:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.