Showing posts with label contents. Show all posts
Showing posts with label contents. Show all posts

Saturday, March 24, 2012

HTML Email Help

I am trying to send an email automatically when a user has filled in a web form.

I have been using the contents of each textbox so that the email can display details of a specific order. For example, txtForename.text, which could contain "Jerry".

I have been trying many different ways to rectify the error, with now luck.

My code looks like this:

' Send Email to customer
Dim Mail As New MailMessage()
Mail.To = lblEmail.text
Mail.From = "rentals@dotnet.itags.org.OCR.com"
Mail.Subject = "Rental Details"
Mail.BodyFormat = MailFormat.Html
Mail.Body = "<h1>Rental Summary</h1><hr /><table width='100%'><tr><td colspan='2'><h2><u>Personal Details</u></h2></td></tr><tr><td></td><td></td></tr>" & _
"<tr><td width='9%'><b>Name:</b></td><td width='91%'>" & lblForename.text & lblSurname.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Address:</b></td><td>"& lblAddress1.text &"</td>" & _
"</tr><tr><td></td><td>"& lblAddress2.text & "</td></tr><tr><td></td><td>" & lblCounty.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Post Code:</b> </td><td>" & lblPostcode.text & "</td>" & _
"</tr><tr><td></td><td></td></tr><tr><td><b>Tel No:</b></td><td>" & lblTelNo.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Email Address:</b> </td>" & _
"<td>" & lblEmail.text & "</td></tr><tr><td></td><td></td></tr></table><br /><table width='100%'><tr><td colspan='2'><h2><u>Purchase Information</u></h2></td>" & _
"</tr><tr><td width='10%'></td><td width='90%'></td></tr><tr><td><b>Car:</b></td><td>" & lblCarModel.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Price:</b></td>" & _
"<td>" & lblCarPrice.text & "</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td><b>Accessory Name:</b></td><td>" & lblAccessoryName.text & "</td></tr><tr><td><b>Price:</b></td>" & _
"<td>" & lblAccessoryPrice.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Pickup Date:</b></td><td>" & lblCollectDate.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Return Date:</b></td>" & _
"<td>" & lblReturnDate.text & "</td></tr></table><br />"
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(Mail)

I have created the email in a table format as you can see. I don't think there is any errors in the email structure. However, I am getting the following error:

Server Error in '/' Application.

The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for someone@dotnet.itags.org.hotmail.com

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 server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for someone@dotnet.itags.org.hotmail.com

Source Error:

Line 153: "<td>" & lblReturnDate.text & "</td></tr></table><br />"
Line 154: SmtpMail.SmtpServer = "localhost"
Line 155: SmtpMail.Send(Mail)
Line 156:
Line 157: Response.Redirect("RecordProcess.aspx")


I would appreciate any help anyone could give me!

You need to pass username/pass to your SMTP or adjust the SMTP to allow your access.

There was a post yesterday with the exact syntax for passing the credentials, but basically that's all it is.


Thats great thanks for your help!

I will try it out!

html editor for update pages contents

Hello,
I develop a Web site ASP.NET which contains dynamic pages (example: News .).
I would want that the administrator of site can add and update contents in
these pages with formatting options (example: colors, fonts.); I believe
that the solution is a small html editor.
Somebody could help me or show me how to make?
Quite other idea will be welcome.
Thank you in advance.
NoroHi Noro,
You might want to check out the free editor that comes with DotNetNuke:
http://www.dotnetnuke.com/
Ken
Microsoft MVP [ASP.NET]
"Noro" <noureddine@.astoine.com> wrote in message
news:%23eWu7VWhGHA.3572@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I develop a Web site ASP.NET which contains dynamic pages (example: News
> .). I would want that the administrator of site can add and update
> contents in these pages with formatting options (example: colors, fonts.);
> I believe that the solution is a small html editor.
> Somebody could help me or show me how to make?
> Quite other idea will be welcome.
>
> Thank you in advance.
> Noro
>

html editor for update pages contents

Hello,

I develop a Web site ASP.NET which contains dynamic pages (example: News .).
I would want that the administrator of site can add and update contents in
these pages with formatting options (example: colors, fonts.); I believe
that the solution is a small html editor.

Somebody could help me or show me how to make?

Quite other idea will be welcome.

Thank you in advance.

NoroJust a remark: My idea is to integrate the html editor into the
administration interface of the site.

Thank you in advance,

Noro

"Noro" <noureddine@.astoine.com> a crit dans le message de news:
%23eWu7VWhGHA.3572@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I develop a Web site ASP.NET which contains dynamic pages (example: News
> .). I would want that the administrator of site can add and update
> contents in these pages with formatting options (example: colors, fonts.);
> I believe that the solution is a small html editor.
> Somebody could help me or show me how to make?
> Quite other idea will be welcome.
>
> Thank you in advance.
> Noro
Hi Noro,

You might want to check out the free editor that comes with DotNetNuke:

http://www.dotnetnuke.com/

Ken
Microsoft MVP [ASP.NET]

"Noro" <noureddine@.astoine.com> wrote in message
news:%23eWu7VWhGHA.3572@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I develop a Web site ASP.NET which contains dynamic pages (example: News
> .). I would want that the administrator of site can add and update
> contents in these pages with formatting options (example: colors, fonts.);
> I believe that the solution is a small html editor.
> Somebody could help me or show me how to make?
> Quite other idea will be welcome.
>
> Thank you in advance.
> Noro

Thursday, March 22, 2012

HTML Contents in GridView Rows Will Not Display as HTML?

Hello all,
I am trying to read a directory listing into a string[] and then use
that data, along with some other data, to create HTML for display in a
gridview row. A sample item in the string[] might look like this...
<div style='vertical-align:middle;'><img src='image.jpb'><a
href='somefile.zip'>somefile.zip</a></div>
I then bind the array to a gridview to show on the form.
This always worked great with a datagrid in VS2003. Now, however, the
gridview handles the HTML differently: if reformats it? What I mean is,
the HTML displays as literal text...the gridview rows really show the
HTML tags (<div>, etc...). When inspecting the page with the browser's
View | Source, I can see that the page has all of the <div> as < div
>. Why is this happening, and how do I fix it? It would be great if
asp.net would not change my code!

HTML Contents in GridView Rows Will Not Display as HTML?

Hello all,

I am trying to read a directory listing into a string[] and then use
that data, along with some other data, to create HTML for display in a
gridview row. A sample item in the string[] might look like this...

<div style='vertical-align:middle;'><img src='image.jpb'><a
href='somefile.zip'>somefile.zip</a></div
I then bind the array to a gridview to show on the form.

This always worked great with a datagrid in VS2003. Now, however, the
gridview handles the HTML differently: if reformats it? What I mean is,
the HTML displays as literal text...the gridview rows really show the
HTML tags (<div>, etc...). When inspecting the page with the browser's
View | Source, I can see that the page has all of the <div> as < div
>. Why is this happening, and how do I fix it? It would be great if
asp.net would not change my code!