Click here to Skip to main content
16,010,876 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: JavaScript can be used in ASP.net ? Pin
Sachin Pimpale11-Jan-07 22:59
Sachin Pimpale11-Jan-07 22:59 
AnswerRe: JavaScript can be used in ASP.net ? Pin
Sam's Den11-Jan-07 23:08
Sam's Den11-Jan-07 23:08 
GeneralRe: JavaScript can be used in ASP.net ? Pin
Sachin Pimpale11-Jan-07 23:12
Sachin Pimpale11-Jan-07 23:12 
GeneralRe: JavaScript can be used in ASP.net ? Pin
Pete O'Hanlon11-Jan-07 23:38
mvePete O'Hanlon11-Jan-07 23:38 
GeneralRe: JavaScript can be used in ASP.net ? Pin
Sachin Pimpale11-Jan-07 23:51
Sachin Pimpale11-Jan-07 23:51 
AnswerRe: JavaScript can be used in ASP.net ? Pin
stephenSmithJ12-Jan-07 6:50
stephenSmithJ12-Jan-07 6:50 
QuestionHow to control hardware via website by ASP.net? Pin
bug_aonz11-Jan-07 21:43
bug_aonz11-Jan-07 21:43 
NewsThe complete ASP.NET email sending code Pin
MissionSuccess11-Jan-07 21:20
MissionSuccess11-Jan-07 21:20 
hello great guys

i m making a site thru which i hav to send emails.
for this i have done some coding as follows:-

Private Sub Sendmail()
Try
Dim Mail As New MailMessage
If TxtEmailFrom.Text = "" Then
lblError.Text = "Please,Enter Sender's Email id."
Exit Sub
Else
Mail.From = TxtEmailFrom.Text
End If

If TxtEmailTo.Text = "" Then
lblError.Text = "Please,Enter Receiver's Email id."
Exit Sub
Else
Mail.To = TxtEmailTo.Text
End If

If txtCC.Text <> "" Then
Mail.Cc = txtCC.Text
End If
If txtBCC.Text <> "" Then
Mail.Bcc = txtBCC.Text
End If
Mail.BodyFormat = MailFormat.Text
Mail.Priority = MailPriority.Normal
If Me.TxtEmailSub.Text <> "" Then
Mail.Subject = TxtEmailSub.Text
End If
If Me.TxtEmailBody.Text <> "" Then
Mail.Body = TxtEmailBody.Text
End If

Dim strfilename, attach1 As String
If Not (File1.PostedFile Is Nothing) Then
Dim attFile As HttpPostedFile = File1.PostedFile
Dim attachFileLength As Integer = attFile.ContentLength
If attachFileLength > 0 Then
strfilename = Path.GetFileName(File1.PostedFile.FileName)
File1.PostedFile.SaveAs(Server.MapPath(strfilename))
Dim attach As MailAttachment = New MailAttachment(Server.MapPath(strfilename))
Mail.Attachments.Add(attach)
attach1 = strfilename
End If
End If

If Not (attach1 Is Nothing) Then
File.Delete(Server.MapPath(attach1))
End If

SmtpMail.SmtpServer = "IP of my SMTP server "
SmtpMail.Send(Mail)
Response.Write("Your mail has been sent successfully.")
Catch ex As Exception
lblError.Text = ex.Message
End Try
End Sub


this piece of code is working fine on my pc where site is being developed.
but problem arises when i m going to deploy it.

error "invalid email attachment."
this is obvious because it executes on the server.
give me some idea so that i can attach the file from clien's PC.
as in various sites like yahoo,gmail,rediffmail etc.
i hope u ppl have understood my problem.
and if any confusion comes
then plz tell me.

regards
Ajay
QuestionAt the place of the control its giving a red mark. Pin
indian14311-Jan-07 21:12
indian14311-Jan-07 21:12 
AnswerRe: At the place of the control its giving a red mark. Pin
_AK_11-Jan-07 21:49
_AK_11-Jan-07 21:49 
GeneralRe: At the place of the control its giving a red mark. Pin
indian14311-Jan-07 22:12
indian14311-Jan-07 22:12 
GeneralRe: At the place of the control its giving a red mark. Pin
_AK_11-Jan-07 22:16
_AK_11-Jan-07 22:16 
GeneralRe: At the place of the control its giving a red mark. Pin
indian14311-Jan-07 22:19
indian14311-Jan-07 22:19 
GeneralRe: At the place of the control its giving a red mark. Pin
_AK_11-Jan-07 22:24
_AK_11-Jan-07 22:24 
GeneralRe: At the place of the control its giving a red mark. Pin
indian14311-Jan-07 22:34
indian14311-Jan-07 22:34 
GeneralRe: At the place of the control its giving a red mark. Pin
J4amieC11-Jan-07 23:13
J4amieC11-Jan-07 23:13 
Questionvalidation summary in javascript Pin
VaibhavTiparadi11-Jan-07 20:44
VaibhavTiparadi11-Jan-07 20:44 
AnswerRe: validation summary in javascript Pin
Sam's Den11-Jan-07 22:46
Sam's Den11-Jan-07 22:46 
Questiondll error Pin
Sebastian T Xavier11-Jan-07 20:29
Sebastian T Xavier11-Jan-07 20:29 
AnswerRe: dll error Pin
Sam's Den11-Jan-07 22:56
Sam's Den11-Jan-07 22:56 
Questionhow to show a message box in asp.net Pin
Rmesh11-Jan-07 20:28
Rmesh11-Jan-07 20:28 
AnswerRe: how to show a message box in asp.net Pin
_AK_11-Jan-07 20:49
_AK_11-Jan-07 20:49 
AnswerRe: how to show a message box in asp.net Pin
mohd imran abdul aziz12-Jan-07 0:37
mohd imran abdul aziz12-Jan-07 0:37 
AnswerRe: how to show a message box in asp.net Pin
tonsum12-Jan-07 1:30
tonsum12-Jan-07 1:30 
QuestionRunning IE in the background Pin
Rajiya11-Jan-07 20:23
Rajiya11-Jan-07 20:23 

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.