•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 426,394 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,309 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 1553 | Replies: 3 | Solved
![]() |
•
•
Join Date: Sep 2006
Posts: 17
Reputation:
Rep Power: 3
Solved Threads: 0
hello there i want to send an email in which user has selected an attachment to send. below is the code for it:
and i am getting this error...........
Server Error in '/Email' Application.
The "SendUsing" configuration value is invalid.
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.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid.
Source Error:
Line 46: End IfLine 47: NextLine 48: TheMailConnection.Send(TheMailMessage)Line 49: End SubLine 50: End Class
asp.net Syntax (Toggle Plain Text)
[color=#0000ff] Imports[/color][color=#000000] System.Web.Mail[/color] [color=#0000ff]Public[/color][color=#000000] [/color][color=#0000ff]Class[/color][color=#000000] WebForm1[/color] [color=#0000ff]Inherits[/color] System.Web.UI.Page #[color=#0000ff]Region[/color] " Web Form Designer Generated Code " [color=#008000]'This call is required by the Web Form Designer. [/color]<System.Diagnostics.DebuggerStepThrough()> [color=#0000ff]Private[/color] [color=#0000ff]Sub[/color] InitializeComponent() [color=#0000ff]End[/color] [color=#0000ff]Sub [/color][color=#0000ff]Protected[/color] [color=#0000ff]WithEvents[/color] txtToEmail [color=#0000ff]As[/color] System.Web.UI.WebControls.TextBox [color=#0000ff]Protected[/color] [color=#0000ff]WithEvents[/color] lbFiles [color=#0000ff]As[/color] System.Web.UI.WebControls.ListBox [color=#0000ff]Protected[/color] [color=#0000ff]WithEvents[/color] butOK [color=#0000ff]As[/color] System.Web.UI.WebControls.Button [color=#008000]'NOTE: The following placeholder declaration is required by the Web Form Designer. [/color][color=#008000]'Do not delete or move it. [/color][color=#0000ff]Private[/color] designerPlaceholderDeclaration [color=#0000ff]As[/color] System.Object [color=#0000ff]Private[/color] [color=#0000ff]Sub[/color] Page_Init([color=#0000ff]ByVal[/color] sender [color=#0000ff]As[/color] System.Object, [color=#0000ff]ByVal[/color] e [color=#0000ff]As[/color] System.EventArgs) [color=#0000ff]Handles[/color] [color=#0000ff]MyBase[/color].Init [color=#008000]'CODEGEN: This method call is required by the Web Form Designer [/color][color=#008000]'Do not modify it using the code editor. [/color]InitializeComponent() [color=#0000ff]End[/color] [color=#0000ff]Sub [/color]#[color=#0000ff]End[/color] [color=#0000ff]Region [/color][color=#0000ff]Private[/color] [color=#0000ff]Sub[/color] Page_Load([color=#0000ff]ByVal[/color] sender [color=#0000ff]As[/color] System.Object, [color=#0000ff]ByVal[/color] e [color=#0000ff]As[/color] System.EventArgs) [color=#0000ff]Handles[/color] [color=#0000ff]MyBase[/color].Load [color=#008000]'Put user code to initialize the page here [/color][color=#0000ff]End[/color] [color=#0000ff]Sub [/color][color=#0000ff]Private[/color] [color=#0000ff]Sub[/color] butOK_Click([color=#0000ff]ByVal[/color] sender [color=#0000ff]As[/color] System.Object, [color=#0000ff]ByVal[/color] e [color=#0000ff]As[/color] System.EventArgs) [color=#0000ff]Handles[/color] butOK.Click [color=#0000ff]Dim[/color] TheMailMessage [color=#0000ff]As[/color] [color=#0000ff]New[/color] MailMessage [color=#0000ff]Dim[/color] TheMailConnection [color=#0000ff]As[/color] SmtpMail [color=#0000ff]Dim[/color] TheAttachment [color=#0000ff]As[/color] MailAttachment [color=#0000ff]Dim[/color] TheItem [color=#0000ff]As[/color] ListItem TheMailMessage.From = "shahdhruv47@yahoo.com" TheMailMessage.To = txtToEmail.Text TheMailMessage.Subject = "File Request" TheMailMessage.Body = "Attached is the information " _ & "you requested." [color=#0000ff]For[/color] [color=#0000ff]Each[/color] TheItem [color=#0000ff]In[/color] lbFiles.Items [color=#0000ff]If[/color] TheItem.Selected = [color=#0000ff]True[/color] [color=#0000ff]Then [/color]TheAttachment = [color=#0000ff]New[/color] MailAttachment( _ Server.MapPath("/Email/C9/" & TheItem.Value)) TheMailMessage.Attachments.Add(TheAttachment) [color=#0000ff]End[/color] [color=#0000ff]If [/color][color=#0000ff]Next [/color]TheMailConnection.Send(TheMailMessage) [color=#0000ff]End[/color] [color=#0000ff]Sub End[/color][color=#000000] [/color][color=#0000ff]Class [/color]
and i am getting this error...........
Server Error in '/Email' Application.
The "SendUsing" configuration value is invalid.
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.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid.
Source Error:
Line 46: End IfLine 47: NextLine 48: TheMailConnection.Send(TheMailMessage)Line 49: End SubLine 50: End Class
•
•
Join Date: Sep 2006
Posts: 17
Reputation:
Rep Power: 3
Solved Threads: 0
•
•
•
•
dude may be the problem coz u didnt add the next line to ur code.
SmtpMail.SmtpServer = "name of ur smtp server and often is localhost"
try that
sam
thank you so much. Now i am able to send mails, but the problem i noticed is that the mail is going to the BULK folder of the person whose email address i am writing in TO field, and also when i specified CC field and a email address then mail goes to the INBOX folder. What is the reason behind this.Plz.
So do you have any solution for this.
Last edited by Dhruv Shah : Oct 30th, 2006 at 2:11 pm.
•
•
Join Date: Mar 2006
Posts: 84
Reputation:
Rep Power: 3
Solved Threads: 1
dude
ofcourse the mail will reach the bulk mail because ur server isnt known to the server u r sending the mail.
u can do the thing to make the mail goes directly to the inbox but i dont know it and i heard it ****ing hard. u have to play with some protocols and other shits.
my advice to u is to be happy with wht u got.
sam
ofcourse the mail will reach the bulk mail because ur server isnt known to the server u r sending the mail.
u can do the thing to make the mail goes directly to the inbox but i dont know it and i heard it ****ing hard. u have to play with some protocols and other shits.
my advice to u is to be happy with wht u got.
sam
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access advertisment ajax asp browser code combo custom data development dom dropdownlist email encryption eu feed firefox google imap microsoft module mozilla net news open source opinion outlook penelope phishing professional reader research reuse scam security skin spam spamming sql technology theme thunderbird weather web webmail windows workflow xml xoap
- Auto Mail in ASP.NET (ASP.NET)
- Clustered Cache in ASP.NET (ASP.NET)
- ASP.NET - session objects Problem (ASP.NET)
- ASP.NET button backcolor changing from code. (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: DropDownList
- Next Thread: Messagebox


Linear Mode