Click here to Skip to main content
15,917,971 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to upload a file to my webserver from another url? Pin
InvalidTypecast25-Jun-07 3:07
InvalidTypecast25-Jun-07 3:07 
GeneralRe: How to upload a file to my webserver from another url? Pin
InvalidTypecast25-Jun-07 5:06
InvalidTypecast25-Jun-07 5:06 
AnswerRe: How to upload a file to my webserver from another url? Pin
sathesh pandian27-Jun-07 19:24
sathesh pandian27-Jun-07 19:24 
GeneralRe: How to upload a file to my webserver from another url? Pin
InvalidTypecast28-Jun-07 4:18
InvalidTypecast28-Jun-07 4:18 
QuestionThe system cannot find the file specified error occurs! Pin
rkherath24-Jun-07 17:35
rkherath24-Jun-07 17:35 
AnswerRe: The system cannot find the file specified error occurs! Pin
Christian Graus24-Jun-07 17:48
protectorChristian Graus24-Jun-07 17:48 
GeneralRe: The system cannot find the file specified error occurs! Pin
rkherath24-Jun-07 18:54
rkherath24-Jun-07 18:54 
QuestionEmail using gmail Pin
Tim_Thomas24-Jun-07 15:35
Tim_Thomas24-Jun-07 15:35 
Hello, I was hoping someone here could assist me with an issue I have. I need to be able to send email to people who are registered on my system. I wish to send them their username and their password. I keep getting an error when I try to send an email: "Failure sending mail."

I am not sure whether my port is incorrect or if I have a syntax error, but I have looked a many examples online and I can't figure out where I am going wrong. Everything seams normal but when I get to the Client.Send(Message) part, it throws the exception, "Failure sending mail."

Any help would be appreciated. The following is a class I call from the front end.

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Text
Imports System.Net
Imports System.Net.Mail
Imports System.Net.Mime
Imports System.Threading

Public Class EmailLibrary

    Private SendTo As String
    Private From As String = "******@gmail.com"
    Private FromName As String = "****************"
    Private Subject As String = "******************"
    Private Body As String
    Private SMTPServer As String = "smtp.gmail.com"
    Private AccessKey As String = "******"
    Private Port As Integer = 587

    Public Sub EmailPasswordAndUserName(ByVal Name As String, ByVal Password As String, ByVal Email As String)

        SendTo = Email

Body = "" & "Username: " & Name _
& "Password: " & Password _
& "Note: " _
& "We encourage you to change your password as soon as you receive this message." _
& "Please refrain from sharing your password with others."

        Dim Message As New System.Net.Mail.MailMessage

        Try

            Message.To.Add(SendTo)
            Message.From = New MailAddress(From, FromName, System.Text.Encoding.UTF8)

            Message.Subject = Subject
            Message.SubjectEncoding = System.Text.Encoding.UTF8

            Message.Body = Body
            Message.BodyEncoding = System.Text.Encoding.UTF8
            Message.IsBodyHtml = True

            Message.Priority = MailPriority.High

            Dim Client As New SmtpClient(SMTPServer)
            Client.Credentials = New System.Net.NetworkCredential(From, AccessKey)
            Client.Port = Port
            Client.Host = SMTPServer
            Client.EnableSsl = True

            Client.Send(Message)

        Catch Ex As Exception
            Throw Ex
        End Try

    End Sub

AnswerRe: Email using gmail Pin
Sathesh Sakthivel24-Jun-07 16:27
Sathesh Sakthivel24-Jun-07 16:27 
QuestionSeeking help with Data Reader Pin
minibansal24-Jun-07 8:00
minibansal24-Jun-07 8:00 
AnswerRe: Seeking help with Data Reader Pin
El Fenomeno24-Jun-07 8:26
El Fenomeno24-Jun-07 8:26 
GeneralRe: Seeking help with Data Reader Pin
minibansal24-Jun-07 8:44
minibansal24-Jun-07 8:44 
GeneralRe: Seeking help with Data Reader Pin
doWhileSomething24-Jun-07 9:06
doWhileSomething24-Jun-07 9:06 
GeneralRe: Seeking help with Data Reader Pin
DavidNohejl24-Jun-07 9:09
DavidNohejl24-Jun-07 9:09 
GeneralRe: Seeking help with Data Reader Pin
Nouman Bhatti24-Jun-07 20:39
Nouman Bhatti24-Jun-07 20:39 
QuestionTreeView - Page callback Pin
El Fenomeno24-Jun-07 6:32
El Fenomeno24-Jun-07 6:32 
AnswerRe: TreeView - Page callback Pin
El Fenomeno13-Jul-07 10:28
El Fenomeno13-Jul-07 10:28 
Questionmaster page problem Pin
rcwoods24-Jun-07 6:01
rcwoods24-Jun-07 6:01 
AnswerRe: master page problem Pin
Sathesh Sakthivel24-Jun-07 6:02
Sathesh Sakthivel24-Jun-07 6:02 
GeneralRe: master page problem Pin
rcwoods24-Jun-07 6:15
rcwoods24-Jun-07 6:15 
GeneralRe: master page problem Pin
rcwoods24-Jun-07 7:20
rcwoods24-Jun-07 7:20 
AnswerRe: master page problem Pin
doWhileSomething24-Jun-07 9:03
doWhileSomething24-Jun-07 9:03 
GeneralRe: master page problem Pin
rcwoods24-Jun-07 10:11
rcwoods24-Jun-07 10:11 
GeneralRe: master page problem Pin
doWhileSomething24-Jun-07 10:26
doWhileSomething24-Jun-07 10:26 
GeneralRe: master page problem Pin
rcwoods24-Jun-07 10:42
rcwoods24-Jun-07 10:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.