---
title: "jmail problem"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/38462-jmail-problem"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Qonos"
published: "2002-02-26T10:28:12.000Z"
updated: "2002-02-26T10:50:10.000Z"
replies: 1
views: 244
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/38462-jmail-problem"
---

# jmail problem

## #1 — Qonos, 2002-02-26T10:28Z

jag skall först och främst säga att ASP e inte min grej :(  har inte kodat typ en rad i asp på 2½ år eller nått så jag e lite "ringrostig"

jag hittade denna koden:

```
First of all we need a form which posts to our JMail page. 
   JmailForm.asp
<html>
<head>
<title>emailform</title>
</head>
<body>
<form method="post" action="SendMail.asp">
   Complete this form and click the submit-button. We will answer your
   questions as soon as possible.
   <br><br>
   Your name<br>
   <input type="text" size="25" name="name"><br>
   
   Your email<br>
   <input type="text" size="25" name="email"><br>   Recipient email<br>
   <input type="text" size="25" name="recipient"><br> State your business<br>
   <select name="subject" size="1">
    <option value="help">help
       <option value="tips">tips
       <option value="other">other
   </select>
   <br> Enter your question<br>
   <textarea name="body" cols="40" rows="15" wrap="PHYSICAL"></textarea>
   <br>
   <input type="submit" value="  Submit ">
</form>
</body>
</html> 

Then we need to catch the post and read the form. Pick up all information and create the e-mail.
 
   SendMail.asp

<%@LANGUAGE = VBSCRIPT%> <html>
<body>

<%

' Get the form data
name        = Request.Form("name")
senderEmail = Request.Form("email")
subject    = "Regarding " & Request.Form("subject")
recipient   = Request.Form("recipient")
body        = Request.Form("body")

' Create the JMail message Object
set msg = Server.CreateOBject( "JMail.Message" )

' Set logging to true to ease any potential debugging
' And set silent to true as we wish to handle our errors ourself
msg.Logging = true
msg.silent = true

' Enter the sender data
msg.From = senderEmail
msg.FromName = name

' Note that as addRecipient is method and not
' a property, we do not use an equals ( = ) sign
msg.AddRecipient recipient

' The subject of the message
msg.Subject = subject

' And the body
msg.body = body

' Now send the message, using the indicated mailserver
if not msg.Send("mail.myDomain.net" ) then
    Response.write "<pre>" & msg.log & "</pre>"
else
    Response.write "Message sent succesfully!"
end if

' And we're done! the message has been sent.

%>
</body>
</html>
```

 

Det kan vara jag som har glömt allt inom ASP men hmm jag hittar inte var mottagar mailadressen skall skrivas in....

Permalänk: https://www.webforum.nu/p/38462

## #2 — @nders, 2002-02-26T10:50Z

Du har med *msg.AddRecipient recipient* i din kod. Den förväntar sig alltså att mottagaradressen ligger i variabeln recipient.

Mvh,

Permalänk: https://www.webforum.nu/p/614222

---

Tråden på webben: https://www.webforum.nu/amne/asp/38462-jmail-problem
