Wrox Programmer Forums
|
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 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 October 30th, 2008, 08:25 AM
Authorized User
 
Join Date: Jul 2008
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="[email protected]">
        <network defaultCredentials="true" host="localhost" port="25" />
      </smtp>
    </mailSettings>
  </system.net>

supertedz
__________________
supertedz
 
Old October 30th, 2008, 11:12 AM
Friend of Wrox
 
Join Date: Jun 2003
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
================================================== =========
 
Old November 1st, 2008, 12:46 AM
Authorized User
 
Join Date: Jul 2008
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:'[email protected]'

<system.net>
    <mailSettings>
      <smtp deliveryMethod="Network">
        <network host="[email protected]" />
      </smtp>
    </mailSettings>
  </system.net>

supertedz
 
Old November 1st, 2008, 12:50 AM
Authorized User
 
Join Date: Jul 2008
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
 
Old November 1st, 2008, 12:25 PM
Friend of Wrox
 
Join Date: Jun 2003
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
================================================== =========
 
Old November 1st, 2008, 03:46 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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.





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





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