function checkcomp(str) on error resume next checkcomp = false Err = 0 dim checkobject set checkobject = Server.CreateObject(str) if 0 = Err then checkcomp = true end if set checkobject = nothing Err = 0 end function
if checkcomp(emailcomp(0)) then emailcomponent="ASPMail" elseif checkcomp(emailcomp(1)) then emailcomponent="CDONTS" else emailcomponent="CDONTS/ASPMail are not installed in your server." end if
'check if ASPMail if emailcomponent="ASPMail" then
Set mail = Server.CreateObject("SMTPsvg.Mailer") mail.ContentType = "text/html" mail.FromAddress = emailFromAddress mail.FromName = emailFromName mail.AddRecipient fullname, email mail.Subject = emailsub mail.BodyText = b mail.RemoteHost = ASPMailRemoteHost mail.SendMail Set Mail = Nothing
'check if CDONTS elseif emailcomponent="CDONTS" then
Set myMail = CreateObject("CDONTS.NewMail") myMail.From = emailFromName & "<" & emailFromAddress & ">" myMail.From = emailFromAddress myMail.To = email myMail.Subject = emailsub myMail.Body = b myMail.BodyFormat = 0 myMail.MailFormat = 0 myMail.Send Set myMail = Nothing end if
' email body b="<html><body>" b=b & "Hej " & fn & ",<br>" b=b & "Velkommen til " & sitename & "<br>" b=b & "<a href='" & rootFolder & "login/activate.asp?id=" & activateCode & "'>Klik her</a> For at arkiver din nye bruger profil</a>." b=b & "<br><br>Brugernavn:<b>" & request("username") & "</b><br>Adgangskode:<b>" & request("password") & "</b><br><br>" b=b & "Med venlig hilden<br><br>" & sitename b=b & "</body></html>"
function checkcomp(str) on error resume next checkcomp = false Err = 0 dim checkobject set checkobject = Server.CreateObject(str) if 0 = Err then checkcomp = true end if set checkobject = nothing Err = 0 end function
if checkcomp(emailcomp(0)) then emailcomponent="ASPMail" elseif checkcomp(emailcomp(1)) then emailcomponent="CDONTS" else emailcomponent="CDONTS/ASPMail are not installed in your server." end if
'check if ASPMail if emailcomponent="ASPMail" then
Set mail = Server.CreateObject("SMTPsvg.Mailer") mail.ContentType = "text/html" mail.FromAddress = emailFromAddress mail.FromName = emailFromName mail.AddRecipient fullname, email mail.Subject = emailsub mail.BodyText = b mail.RemoteHost = ASPMailRemoteHost mail.SendMail Set Mail = Nothing
'check if CDONTS elseif emailcomponent="CDONTS" then
Set myMail = CreateObject("CDONTS.NewMail") myMail.From = emailFromName & "<" & emailFromAddress & ">" myMail.From = emailFromAddress myMail.To = email myMail.Subject = emailsub myMail.Body = b myMail.BodyFormat = 0 myMail.MailFormat = 0 myMail.Send Set myMail = Nothing end if
Du skal jo bruge en eller anden form for smtp server til a sende din mail med, men hvis du har en smtp server installeret på din server kan du bruge den (localhost).
nu har jeg fået af vide at smtp server hedder smtp.mail.dk men den vil bare ikke afsende mails til den tilmeldte bruger. nogen der kan fortælle hvorfor?
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.