Welcome to WebmasterWorld Guest from 35.173.57.202

Forum Moderators: ocean10000

Message Too Old, No Replies

Converting form for email in .net environment

Form email help required

     
2:54 pm on Dec 3, 2009 (gmt 0)

New User

5+ Year Member

joined:Dec 3, 2009
posts: 8
votes: 0


I am new to the .net environment. I have created a form with lot's of functionality. Now I need to be able to email the form content including an attachment(s). I think I will have to convert my form to make this happen. I am posting my code for help in accomplishing this. I am not sure of what I need to do to convert this form. Any help would be greatly appreciated.


<form action="send_email.aspx" method="post" enctype="multipart/form-data" id="infoForm" name="infoForm" onsubmit="return validateForm();" >
<label class="requiredField">
<input type="hidden" class="DEPENDS ON os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt OR custO BEING lender OR custO BEING borrower OR custO BEING othr"/>
<span class="requiredField"><strong><em>*Required fields</em></strong></span></label>
<label id=genllbl> <input type="hidden" id="error_msg" name= "error_msg" /><strong>General Information</strong>
<input type="radio" name="os" id="genlOpt" value="genlOpt" onclick = "checkValue(infoForm)"/>
</label>
<label id=custlbl><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Customer Care</strong>
<input type="radio" name="os" id="custOpt" value="custOpt" onclick = "checkValue(infoForm)"/>
</label>
<label id=medialbl><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Media Kit</strong>
<input type="radio" name="os" id="mediaOpt" value="mediaOpt" onclick = "checkValue(infoForm)"/>
</label>
<strong>
<label id=careerlbl>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Career Opportunities
<input type="radio" name="os" id="careerOpt" value="careerOpt" onclick = "checkValue(infoForm)"/>
</label> <br />
<label><strong>Are you a: Member Lender</strong><a href="#" class="hintanchor" onmouseover="showhint('A member of an organization that subscribes to and utilizes PayNetís services.', this, event, '150px')">(?)</a>
<input id="lender" type="radio" name="custO" class="DEPENDS ON os BEING custOpt" value="lender" onclick="setSubj()"/>
</label>
<label><strong>&nbsp;&nbsp;&nbsp;Borrower</strong><a href="#" class="hintanchor" onmouseover="showhint('An organization or sole proprietor seeking financing from one of PayNetís Member Lenders.', this, event, '150px')">(?)</a>
<input id="borrower" type="radio" name="custO" value="borrower" class="DEPENDS ON os BEING custOpt" onclick="setSubj()"/></label>
<label><strong>&nbsp;&nbsp;&nbsp;Other</strong><a href="#" class="hintanchor" onmouseover="showhint('An organization or sole proprietor that does not fit the profile of a Member Lender or a Borrower.', this, event, '150px')" >(?)</a><input id="othr" type="radio" name="custO" value="othr" class="DEPENDS ON os BEING custOpt" onclick="setSubj()"/></label>

<p>
<label><strong>Do you want a free copy of your PayNet Credit History Report? Yes</strong>
<input type="radio" name="chrRqst" class="DEPENDS ON custO BEING borrower" value="yes"/>
</label>
<label><strong>&nbsp;&nbsp;&nbsp;No</strong>
<input type="radio" name="chrRqst" value="no" class="DEPENDS ON custO BEING borrower"/></label>
</p>
<p>
<label><strong>How would you like to receive the report? By Email</strong>
<input type="radio" name="chrRec" class="DEPENDS ON chrRqst BEING yes" value="email"/>
</label>
<label><strong>&nbsp;&nbsp;&nbsp;By Fax</strong>
<input type="radio" name="chrRec" value="fax" class="DEPENDS ON chrRqst BEING yes" />
</label>
</p>
<p>
<label><input type='hidden' class="DEPENDS ON chrRec BEING email"/>
<em><strong>Please complete the form below <br />
OR <br />
If you would like to submit your request by email</strong>, please submit your request to: <a href="mailto:support@example.com">support@example.com</a><br />
Your company's email address must include the company's/organizations name as part of the domain name, such as mike@abccompany.com.
<br />
Please enter in the subject line of the email - &quot;Request for Credit History Report&quot;;<br />
Please include in the body of your email: <br />
The company's/organization's full address including city and state;<br />
A contact person and phone number in case we have additional questions
</em></label>
</p>
<p>
<label><input type='hidden' class="DEPENDS ON chrRec BEING fax"/>
<em><strong>Please complete the form below <br />
OR <br />
If you would like to submit your request by fax</strong>, please submit your request on company letterhead and send your fax to: 847-965-9828, Attention:Support.<br />
Please include in the body of your fax:<br />
&quot;Request for Credit History Report&quot;;<br />
The company's/organization's full address including city and state;<br />
A contact person and phone number in case we have additional questions;<br />
The fax number where you would like your Report sent
</em></label>
</p>
<p>
<label><strong>Would you like to download the Media Kit (PDF)?</strong>
<input name="medOpt" type="radio" class="DEPENDS ON os BEING mediaOpt" onclick="doredirect();" value="dwnld"/>
</label></p>
<p>
<label><strong>Or request a hard copy to be mailed to you?</strong>
<input name="medOpt" type="radio" class="DEPENDS ON os BEING mediaOpt" value="hrdCpy" onclick="setSubj()"/>
</label>
</p>
<label>
<input type="hidden" class="DEPENDS ON os BEING careerOpt"/>
<font color="#000099">
<strong><em>Contact Information:<br />
=================================================================<br />
</em></strong></font></label>
<p>
<label><strong>&nbsp;&nbsp;Company Name</strong>
<input name="cmpyName" type="text" class="DEPENDS ON os BEING genlOpt OR medOpt BEING hrdCpy OR custO BEING lender OR custO BEING borrower OR custO BEING othr" id="cmpyName" size="60" maxlength="60"/>
<br />
<br />
</label>
<label>

<span class="requiredField"><strong>*</strong></span><strong>First Name</strong>
<input name="firstName" type="text" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" id="firstName" value="" size="30" maxlength="30"/>
</label>
<label><span class="requiredField"><strong>*</strong></span><strong>Last Name</strong>
<input name="lastName" type="text" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" id="lastName" value="" size="30" maxlength="50"/>
</label>
<br />
</p>
<p>
<label><span class="requiredField"><strong>*</strong></span><strong>Address1 </strong>
<input name="add1" type="text" class="DEPENDS ON custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" id="add1" value="" size="50" maxlength="50"/>
</label>
</p>
<p>
<label><strong>&nbsp;&nbsp;Address2
</strong>
<input name="add2" type="text" class="DEPENDS ON custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" id="add2" value="" size="50" maxlength="50"/>
</label>
</p>
<p>
<label><span class="requiredField"><strong>*</strong></span><strong>Country:</strong> United States
<input type="radio" name="cntryO" value="US" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt"/>
</label>
<label>Canada<input type="radio" name="cntryO" value="CA" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt"/></label>
<br />
</p>
<p>
<label><span class="requiredField"><strong>*</strong></span><strong>City</strong>
<input name="addCity" type="text" class="DEPENDS ON os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt OR custO BEING othr" id="addCity" onfocus="valCountry(infoForm)" size="25" maxlength="25"/>
</label>
<label><span class="requiredField"><strong>*</strong></span><strong>Province</strong>
<select name="Province" id="Province" class="DEPENDS ON cntryO BEING CA AND os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt AND CONFLICTS WITH custO BEING lender">
<option value="">SELECT ONE</option>
<option value="AB">Alberta</option>
<option value="BC">British Columbia</option>
<option value="MB">Manitoba</option>
<option value="NB">New Brunswick</option>
<option value="NL">Newfoundland and Labrador</option>
<option value="NS">Nova Scotia</option>
<option value="NT">Northwest Territories</option>
<option value="NU">Nunavut</option>
<option value="ON">Ontario</option>
<option value="PE">Prince Edward Island</option>
<option value="QC">Quebec</option>
<option value="SK">Saskatchewan</option>
<option value="YT">Yukon</option>
</select>
</label>
<label><span class="requiredField"><strong>*</strong></span><strong>State</strong>
<select name="addState" id="addState" class="DEPENDS ON cntryO BEING US AND os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt AND CONFLICTS WITH custO BEING lender">
<option value="">SELECT ONE</option>
<option value='0' >Alabama</option>
<option value='1' >Alaska</option>
<option value='2' >Arizona</option>
<option value='3' >Arkansas</option>
<option value='4' >California</option>
<option value='5' >Colorado</option>
<option value='6' >Connecticut</option>
<option value='7' >Delaware</option>
<option value='8' >District of Columbia</option>
<option value='9' >Florida</option>
<option value='10' >Georgia</option>
<option value='11' >Hawaii</option>
<option value='12' >Idaho</option>
<option value='13' >Illinois</option>
<option value='14' >Indiana</option>
<option value='15' >Iowa</option>
<option value='16' >Kansas</option>
<option value='17' >Kentucky</option>
<option value='18' >Louisiana</option>
<option value='19' >Maine</option>
<option value='20' >Maryland</option>
<option value='21' >Massachusetts</option>
<option value='22' >Michigan</option>
<option value='23' >Minnesota</option>
<option value='24' >Mississippi</option>
<option value='25' >Missouri</option>
<option value='26' >Montana</option>
<option value='27' >Nebraska</option>
<option value='28' >Nevada</option>
<option value='29' >New Hampshire</option>
<option value='30' >New Jersey</option>
<option value='31' >New Mexico</option>
<option value='32' >New York</option>
<option value='33' >North Carolina</option>
<option value='34' >North Dakota</option>
<option value='35' >Ohio</option>
<option value='36' >Oklahoma</option>
<option value='37' >Oregon</option>
<option value='38' >Pennsylvania</option>
<option value='39' >Puerto Rico</option>
<option value='40' >Rhode Island</option>
<option value='41' >South Carolina</option>
<option value='42' >South Dakota</option>
<option value='43' >Tennessee</option>
<option value='44' >Texas</option>
<option value='45' >Utah</option>
<option value='46' >Vermont</option>
<option value='47' >Virginia</option>
<option value='48' >Washington</option>
<option value='49' >West Virginia</option>
<option value='50' >Wisconsin</option>
<option value='51' >Wyoming</option>
</select>
</label>
</p>
<p>
<label>
<span class="requiredField"><strong>*</strong></span><strong>Zip/Postal Code</strong>
<input name="addZip" type="text" class="DEPENDS ON custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" id="addZip" size="9" maxlength="9"/></label>
</p>
<p>
<label>
<strong>&nbsp;&nbsp;Bus Phone</strong>
<input name="busPhone" type="text" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" id="busPhone" size="10" maxlength="10"/>
</label>
<label><strong>Cell Phone</strong>
<input name="cellPhone" type="text" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" id="cellPhone" size="10" maxlength="10"/>
</label>
<label><strong>Home Phone</strong>
<input name="hmPhone" type="text" class="DEPENDS ON os BEING careerOpt" id="hmPhone" size="10" maxlength="10"/>
</label>
<br />
</p>
<p>
<label><strong>&nbsp;&nbsp;Fax</strong>
<input name="addFax" type="text" class="DEPENDS ON custO BEING lender OR chrRec BEING fax OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" id="addFax" size="12" maxlength="12"/>
</label>
<br />
</p>
<p>
<label><strong>&nbsp;&nbsp;Email</strong>
<input name="emailAdr" type="text" class="DEPENDS ON os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt OR custO BEING lender OR custO BEING othr OR chrRec BEING email" id="emailAdr" size="60" maxlength="60"/>
</label>
</p>
<label><span class="requiredField"><strong>*</strong></span><strong>Preferred method of contact</strong>
<select name="prefCnt" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" id="prefCnt" onfocus="valCntInfo()" >
<option value="">SELECT ONE</option>
<option value="bus">Business Phone</option>
<option value="cell">Cell/Mobile Phone</option>
<option value="home">Home Phone</option>
<option value="fax">Fax</option>
<option value="email">Email </option>
</select>
</label>
<label><strong>Best time to contact you
</strong>
<input type="text" name="conTime" id="conTime" class="DEPENDS ON os BEING careerOpt"/>
</label><br /><br />
<label>
<input type="hidden" class="DEPENDS ON os BEING careerOpt"/>
<font color="#000099">
<strong><em>Application Information:<br />
=================================================================</em></strong></font></label>
<label><strong><br />
<br />
&nbsp;&nbsp;Upload your Cover Letter</strong>
<input type="file" name="upCover" id="upCover" class="DEPENDS ON os BEING careerOpt"/>
</label>
<label><strong><br />
<em>&nbsp;&nbsp;OR</em></strong><br />
<strong>&nbsp;&nbsp;Copy and paste your Cover Letter</strong><br />
<textarea name="pstCvr" cols="50" rows="14" class="DEPENDS ON os BEING careerOpt" id="pstCvr"></textarea>
</label>
<p> <label><strong>&nbsp;&nbsp;Upload your Resume</strong>
<input type="file" name="upResume" id="upResume" class="DEPENDS ON os BEING careerOpt"/>
<br />
</label>
<label><strong><em>&nbsp;&nbsp;OR</em></strong><br />
<strong>&nbsp;&nbsp;Copy and paste your Resume</strong><br />
<textarea name="pstResume" cols="50" rows="14" class="DEPENDS ON os BEING careerOpt" id="pstResume"></textarea>
</label>
</p>
<div>
<label>
<select name="firstlevel" id="firstlevel" disabled="disabled" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" >
</select>
<strong><span class="requiredField">*</span></strong><strong>Subject Line</strong></label>
<select name="secondlevel" id="secondlevel" value="" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" onblur="check2nd();">
</select>
</div>

<label id=displayOthr style="visibility:hidden" ><strong><br />
<span class="requiredField">*</span><strong>Other Request Subject</strong>
<input name="subjOthr" type="text" id="subjOthr" size="60" maxlength="60" />
</label>
<label>
<strong><br />
<br />
&nbsp;&nbsp;What can we do for you? </strong>(max. 300 characters)<br />
<textarea name="comments" cols="60" rows="5" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy" id="comments" style="width:250px" onfocus="valCntInfo()"></textarea>
</label>
<label class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy">
<div id="comments-status" > </div>
</label>
<br />
<label><input type="reset" name="reset" id="reset" value="Reset" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt"/>
</label>
<label><input type="submit" name="Submit" id="Submit" value="Submit" class="DEPENDS ON custO BEING lender OR custO BEING borrower OR custO BEING othr OR os BEING genlOpt OR medOpt BEING hrdCpy OR os BEING careerOpt" />
</label>
</form>

[edited by: marcel at 8:31 am (utc) on Dec. 4, 2009]
[edit reason] examplified [/edit]

5:05 pm on Dec 3, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:733
votes: 0


Hi Valeda,

A good place to start with emailing in ASP.Net is here:
[systemnetmail.com...]

I would advise you to first start with a simple form as a test and then extend the functionality when you've got it working.

5:15 pm on Dec 3, 2009 (gmt 0)

New User

5+ Year Member

joined:Dec 3, 2009
posts: 8
votes: 0


Thanks Marcel,
This is great information for sending the email. What about the email itself? Will this send my form as it is?
6:24 pm on Dec 3, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:733
votes: 0


Will this send my form as it is?

No, you will need to extract the values from the form when sending.

You could try building a simple form in Visual Studio, and then send the email as follows:


//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@example.com");
mail.To.Add("you@example.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "Name " + txtName.Text;
mail.Body += "email " + txtEmail.Text;

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

where txtName and txtEmail are <asp:TextBox /> controls

7:18 pm on Dec 3, 2009 (gmt 0)

New User

5+ Year Member

joined:Dec 3, 2009
posts: 8
votes: 0


OK. Let me rephrase my question.... do I need to add "asp:" tags to the form? I created the send_email.aspx file that is called in the action= with. When I submit the form, I get an empty page. I am not sure if it is correct.


<% @language=C# aspcompat=true %>
using System.Net.Mail;
<script runat=server>

void send_email() {
System.Net.Mail.MailMessage email_msg = new System.Net.Mail.MailMessage();
email_msg.To = "vwilliams@example.com"; //strUserEmail;
email_msg.From = "support@example.com";
email_msg.Cc = "";
string str1 = "Reset password confirmation";
email_msg.Subject = str1;
email_msg.Body = "aje;;poipnmpgda" ;

System.Net.Mail.SmtpMail.SmtpServer = "mail.example.com";
System.Net.Mail.SmtpMail.Send(email_msg);
//
error_msg = "Email was sent.";
// Context.Response.Redirect ("confirm.aspx?UserName="+strUserEmail+"&action=ConfirmReset");*/
}

</script>

[edited by: marcel at 6:03 am (utc) on Dec. 4, 2009]
[edit reason] examplified [/edit]

7:31 pm on Dec 3, 2009 (gmt 0)

New User

5+ Year Member

joined:Dec 3, 2009
posts: 8
votes: 0


I removed the language and script tags and tried to run again. Both times I get a blank page in IE. In Firefox I get the error message:

XML Parsing Error: no element found
Location: http ://turkey/wwwcorp_phase2/root/send_email.aspx
Line Number 1, Column 1:

[edited by: marcel at 5:08 pm (utc) on Dec. 4, 2009]
[edit reason] delinked [/edit]

6:13 am on Dec 4, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:733
votes: 0


I think that the problem is that you are looking at the problem from a classic ASP point of view. The code in your first post is a HTML form, not ASP.Net.

You could extract the values from what is posted to the send_emal.aspx page with Request["variableName"]; and adding them one by one to the body of your email.

But, you wouldn't really be using ASP.Net as it was intended.

Here is a good example from 4 guys from Rolla:
[4guysfromrolla.com...]

2:11 pm on Dec 4, 2009 (gmt 0)

New User

5+ Year Member

joined:Dec 3, 2009
posts: 8
votes: 0


I am used to asp. I am new to the asp.net environment. At this point, I would just like to get the email working. As you can see, this is a complicated form. It would take a lot of time for me to convert it. May going with Request["variableName"]; would be a quick answer. I do have exception logic for what information will be in the email, depending on who it will be the recipient. Then once it is up and functioning, I can take the time to convert it to asp.net and C#.

Thanks for the link. There is a wealth of information there.

2:34 pm on Dec 4, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:733
votes: 0


At this point, I would just like to get the email working. As you can see, this is a complicated form. It would take a lot of time for me to convert it.

Don't get me wrong, I'm not trying to criticize you, I'm just trying to point out that ASP.Net is a very different beast than Classic ASP. We've all had to make the transition, and sometimes it is a bit difficult to get your head around ASP.Net WebForm concepts.

I have found that taking a step back and creating a new, simple page with only the basics helps me grasp how it all works. After that I attempt a more challenging conversion like the one you are facing.

Here is some code that should work:
send_email.aspx


<%@ Page Language="C#" %>
<%@ Import Namespace="System.Net.Mail" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@example.com");
mail.To.Add("you@example.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "Name " + Request["txtName"];
mail.Body += "email " + Request["txtEmal"];

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
</script>

3:46 pm on Dec 4, 2009 (gmt 0)

New User

5+ Year Member

joined:Dec 3, 2009
posts: 8
votes: 0


Hey! I actually got an email, but I am also getting an error in Firefox:

XML Parsing Error: no element found
Location: http ://turkey/wwwcorp_phase2/root/send_email.aspx
Line Number 1, Column 1:

[edited by: marcel at 5:09 pm (utc) on Dec. 4, 2009]
[edit reason] delinked [/edit]

6:24 pm on Dec 22, 2009 (gmt 0)

New User

5+ Year Member

joined:Dec 3, 2009
posts: 8
votes: 0


Hi, Still getting an 'XML Parsing Error: no element found ' error in Firefox, but the email is working in Internet Explorer. My next problem is sending 2 attachments uploaded in the form.
7:07 pm on Dec 22, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:733
votes: 0


the XML Parsing Error: no element found usually occurs when Firefox is expecting HTML content but the page is blank, outputting some HTML content should fix the problem.

If you are using an asp:FileUpload control to upload attachments you can add them to your email as follows:


if (FileUpload1.HasFile)
{
string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
Attachment myAttachment = new Attachment(FileUpload1.FileContent, fileName);
myMailMessage.Attachments.Add(myAttachment);
}
7:32 pm on Dec 22, 2009 (gmt 0)

New User

5+ Year Member

joined:Dec 3, 2009
posts: 8
votes: 0


Unfortunately, I am not using asp controls.
8:16 am on Dec 23, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:733
votes: 0


Unfortunately, I am not using asp controls.

If you want to send the mail with ASP.Net I would advise using WebForm controls, it will make it so much easier.

Otherwise you will need to upload the file manually, store it in a temporary location, and then attach the message:

myMailMessage.Attachments.Add(new Attachment(Server.MapPath("/TempUploads/uploadedfile.doc")));
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members