# ASP SMTPsvg.Mailer

**URL:** <https://forum.kirupa.com/t/asp-smtpsvg-mailer/28829>\
**Category:** programming\
**Created:** [August 19, 2003, 2:38am UTC](https://forum.kirupa.com/t/asp-smtpsvg-mailer/28829 "2003-08-19T02:38:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashermx](https://avatars.discourse-cdn.com/v4/letter/f/e5b9ba/32.png) [@flashermx](https://forum.kirupa.com/u/flashermx)\
**Post date:** [August 19, 2003, 2:38am UTC](https://forum.kirupa.com/t/asp-smtpsvg-mailer/28829/1 "2003-08-19T02:38:01Z")

</div>

I’m using this server object to send emails to my account from data put into a form. When I set the Mailer properties to text/html all works and I can code in html but I can’t create line breaks after my form requests & VBCrLf wont work because I’m formating in html. What to do.

:mario:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 19, 2003, 3:16am UTC](https://forum.kirupa.com/t/asp-smtpsvg-mailer/28829/2 "2003-08-19T03:16:00Z")

</div>

\<BR\> or \<P\> doesn’t work?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2003, 12:06am UTC](https://forum.kirupa.com/t/asp-smtpsvg-mailer/28829/3 "2003-08-20T00:06:05Z")

</div>

Here is the code without the html:

Set Mailer = Server.CreateObject(“SMTPsvg.Mailer”)

```
Mailer.FromName = Request.Form ("from")

Mailer.FromAddress= Request.Form("email address")

Mailer.RemoteHost = "privacy"

Mailer.AddRecipient "privacy"

Mailer.Subject = "Web Site"

sBodyText = "The following is feedback from my web site." & VBCrLf

sBodyText = sBodyText & "Favorite color Is " & Request.Form("color")& VBCrLf

sBodyText = sBodyText & "The gender is " & Request.Form("gender")& VBCrLf

sBodyText = sBodyText & "" & request.form("comments")

Mailer.BodyText = sBodyText 

Mailer.SendMail

Response.redirect "privacy.asp"

Response.end

```

This works. Below is the code with the HTML

Set Mailer = Server.CreateObject(“SMTPsvg.Mailer”)

```
Mailer.FromName = Request.Form ("from")

Mailer.FromAddress= Request.Form("email address")

Mailer.RemoteHost = "privacy"

Mailer.AddRecipient "privacy"

Mailer.Subject = "Web Site"

sBodyText = "&lt;b&gt;The following is feedback from my web site.&lt;/b&gt;&lt;br&gt;"

sBodyText = sBodyText & "&lt;b&gt;Favorite color Is &lt;/b&gt;" & Request.Form("color")&lt;br&gt;

sBodyText = sBodyText & "&lt;b&gt;The gender is&lt;/b&gt; " & Request.Form("gender")&lt;br&gt;

sBodyText = sBodyText & "" & request.form("comments")

            Mailer.ContentType = "text/html"

Mailer.BodyText = sBodyText 

Mailer.SendMail

Response.redirect "privacy.asp"

Response.end

```

With the \<br\> an error is produced. Without it the form works but the text is in one long line when it comes to the part with the Request.Form. What to do? Forget the html formatting?:pope:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2003, 12:18am UTC](https://forum.kirupa.com/t/asp-smtpsvg-mailer/28829/4 "2003-08-20T00:18:55Z")

</div>

Unless I’ve misread the documentation, the following should work.

sBodyText = “\<b\>The following is feedback from my web site.\</b\>\<p\>”

sBodyText = sBodyText & “\<b\>Favorite color Is \</b\>” & Request.Form(“color”) & “\<br\>”

sBodyText = sBodyText & “\<b\>The gender is \</b\>” & Request.Form(“gender”) & “\<br\>”

sBodyText = sBodyText & “” & request.form(“comments”)

Mailer.ContentType = “text/html”

Mailer.BodyText = sBodyText

[http://www.serverobjects.com/comp/Aspmail4.htm](http://www.serverobjects.com/comp/Aspmail4.htm)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2003, 2:49am UTC](https://forum.kirupa.com/t/asp-smtpsvg-mailer/28829/5 "2003-08-21T02:49:53Z")

</div>

Thanks abzoid that was it. I knew it had to do with my syntax. Great!

Thanks

:ch:
