PDA

View Full Version : how to send a HTml page with CSS and Pictures to users?


NinjaTurtle
12-10-2002, 07:52 AM
how to send a HTML page with CSS and Pictures to users using ASP??

glenngv
12-10-2002, 08:23 AM
I didn't get what you exactly mean.
Could you explain more details please?

NinjaTurtle
12-10-2002, 08:53 AM
ok, now i have a form registration form, after user user fill in the form, after save into database i will kick out an email with the particular user registration detail to my mailbox. the email will not just plain text, the mail will include CSS and Pictures.

glenngv
12-10-2002, 08:59 AM
then, attach them in your auto-email

codefox
12-10-2002, 09:26 AM
Instead of sending a mail, why not send a link? I mean, just upload your form, css, pictures to your website (well, i assume you have 1) and send a link to the form.

NinjaTurtle
12-10-2002, 09:50 AM
i know i hav to attach them but is not work...

sample code:
.Fields("FEMAILID") = "1"
.Fields("FTOEMAIL") = "ninja@yahoo.com"
.Fields("FTONAME") = "Web Master"
.Fields("FHTML")="Y"
.Fields("FSUBJECT") = "Registration Form "
.Fields("FBODY") = "<HTML><head></head><Body>"+_
"<link href='aa1.css' rel='styleSheet' type='text/css'>"+ _
"<BR><B>Subject : </b>" &request.form("subject")+ _
"<BR><B>Body : </b>" &request.form("remarks")+ _
"<BR><HR><B>Name :</B>" & request.form("name")+ _
"<BR><B>Company : </b>" & request.form("company")+ _
"<BR><B>Designation : </b>" & request.form("designation")+ _
"<BR><B>Address : </b>" & request.form("address")+ _
"<BR><B>Email : </b>" &request.form("email")+ _
"</BODY></HTML>"

i try to open a table, but even i set the table border=0,when reading the mail the border still came out... :(
and CSS not work at all.

glenngv
12-10-2002, 10:10 AM
is this the email attachment code?
I think this is just the part where you save the content in the database.

whammy
12-12-2002, 12:36 AM
objMail.mailFormat = 0
objMail.bodyFormat = 0

This will produce an HTML CDONTS email. Change objMail to whatever your mail object is if you are using CDONTS. No need to "attach" an HTML page since you can send it as HTML. ;)

Mhtml
12-12-2002, 08:37 AM
You can use fso to include non-dynamic html documents.
Which you can send as the message.

angiras
12-12-2002, 08:47 AM
with asp net

Dim mm As New MailMessage()

Dim sb As New StringBuilder()
Dim sw As New StringWriter(sb)
Dim htmlTw As New HtmlTextWriter(sw)

yourPageContainer.RenderControl(htmlTw)

With mm
.From = retw@rgwerg.com
.To = qqq@regt3e5.com
.Subject = "any"
.BodyFormat = MailFormat.Html
.Priority = MailPriority.High
.Body = sb.ToString
End With

SmtpMail.Send(mm)



and you are done


the only thing you need is to have into your html page the completre url for pictures and styleSheet

src="http://www.yoursite.com/style/mySheeet.css"

angiras
12-12-2002, 08:48 AM
I mean it is not an attachment but an HTML mail

Mhtml
12-12-2002, 10:00 AM
*Slaps forhead* It has been described how to send both AS an attachemnt and WITHOUT an attachment..

:mad: Please read the replies again. Whammy told you what settings need to be added into your cdonts code to allow you to send as html , just have the string for the body incoporate html code....





Sorry if I when a little over board with the reply but please throughly read replies.

whammy
12-13-2002, 01:13 AM
For more info on CDONTS (and other ASP mail objects), see here:

http://www.aspfaqs.com/aspfaqs/ShowCategory.asp?CatID=10