p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Basics (http://p2p.wrox.com/forumdisplay.php?f=136)
-   -   Smtp (http://p2p.wrox.com/showthread.php?t=71254)

teddyk October 30th, 2008 08:25 AM

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

gbianchi October 30th, 2008 11:12 AM

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
================================================== =========

teddyk November 1st, 2008 12:46 AM

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

teddyk November 1st, 2008 12:50 AM

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

gbianchi November 1st, 2008 12:25 PM

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
================================================== =========

Imar November 1st, 2008 03:46 PM

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.


All times are GMT -4. The time now is 02:16 PM.

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