Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 26th, 2008, 10:47 AM
Registered User
Points: 25, Level: 1
Points: 25, Level: 1 Points: 25, Level: 1 Points: 25, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2008
Location: Glastonbury, CT, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to janla2112
Default Creating E-Mail Messages

HI,
I am trying to use my yahoo mail account to send and receive a message. I wasn't sure how to set this up...I tried enabling the ssl property. Also, the book mentions adding a username and password, but it wasn't clear on where to insert that. I will post the error message here. However, all it is saying is it is timing out and can't connect so I know it had something to do with the code.
I will also post my web.config and Code Behind for the Email file as well.

Thanks,
Jan


Server Error in '/' Application.
--------------------------------------------------------------------------------

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 69.147.102.58:25
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 69.147.102.58:25

Source Error:


Line 12: Dim mySmtpClient As SmtpClient = New SmtpClient()
Line 13: mySmtpClient.EnableSsl = True
Line 14: mySmtpClient.Send(myMessage)
Line 15: End Sub
Line 16: End Class


Source File: C:\BegASPNET\Site\Demos\Email.aspx.vb Line: 14
__________________________________________________ _______________
Web.config file:

<system.net>
    <mailSettings>
     <smtp deliveryMethod="Network" from="Jan Lawrence &lt;xxxxxxx@yahoo.com.Com&gt;">
        <network host="smtp.mail.yahoo.com"/>
     </smtp>
    </mailSettings>
</system.net>
__________________________________________________ _________________

Email file:

Imports System.Net.Mail
Partial Class Email
Inherits BasePage

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim myMessage As MailMessage = New MailMessage()
    myMessage.Subject = "Test Message"
    myMessage.Body = "Hello world, from Planet Wrox"
    myMessage.From = New MailAddress("xxxxxx@yahoo.com", "Jan Lawrence")
    myMessage.To.Add(New MailAddress("xxxxxx@yahoo.com", "Jan Lawrence"))

    Dim mySmtpClient As SmtpClient = New SmtpClient()
    mySmtpClient.EnableSsl = True
    mySmtpClient.Send(myMessage)
End Sub
End Class



Jan
  #2 (permalink)  
Old October 26th, 2008, 11:10 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Jan,

A couple of things...

First of all, can you please post book related messages in its own forum located here: http://p2p.wrox.com/forum.asp?FORUM_ID=386
That way, I won't overlook them, and other readers will find it easier to find answers to questions they may have,

Secondly, configuring security for your mail server is discussed on page 308 and onwards. You'll see how to add the user name and password in the web.config file.

Finally, are you sure Yahoo allows you to use their mail server like this?

BTW: you may want to edit your message and get rid of your e-mail addresses.

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.
  #3 (permalink)  
Old October 26th, 2008, 12:39 PM
Registered User
Points: 25, Level: 1
Points: 25, Level: 1 Points: 25, Level: 1 Points: 25, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2008
Location: Glastonbury, CT, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to janla2112
Default

HI Imar,
Thanks for the heads up on the e-mail. Bonehead mistake. That was I wasn't sure about. Do you know if sbcglobal allows you to do it either as I think they were swallowed by yahoo as well. Otherwise, I am dead in the water.

Thanks,
Jan

Jan
  #4 (permalink)  
Old October 26th, 2008, 01:23 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

I don't know as I don't know sbcglobal.

But they'll probably have FAQs or a helpdesk that can answer this?

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.
 


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
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
Send messages to users not using e-mail Clayton_Couto General .NET 0 July 19th, 2006 07:23 AM
Sending both text mail and HTML mail - CDONTS madhukp Classic ASP Basics 1 October 8th, 2003 01:05 AM



All times are GMT -4. The time now is 10:40 PM.


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