1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

from asp mailer to smtp script

Discussion in 'Web Design & Development' started by staso, Sep 28, 2008.

Thread Status:
Not open for further replies.
  1. staso

    staso Thread Starter

    Joined:
    Sep 27, 2008
    Messages:
    11
    hi, can anybody help me with that? i have password reminder, that worked with regular mailer...now i need to send passwords via smtp server
    this is the reminder(old) :

    <%
    dim rsGetPass
    dim customer_username, customer_email, customer_name, action
    action = dbtext(request.form("action"))
    customer_username = dbtext(request.form("username"))
    customer_email = dbtext(request.form("email"))

    if action = "getPass" then
    call open_connection
    Set rsGetPass = Server.CreateObject("ADODB.Recordset")
    sSQL = " Select * from tbl_customers where customer_email = '"&customer_email&"' and customer_deleted = 0"
    rsGetPass.open sSQL,objConn,adOpenStatic, adLockOptimistic, adCmdText
    if not rsGetPass.eof then
    found = true
    bodyText = "<table cellpadding='5' cellspacing='0'>" &_
    " <tr>" &_
    " <td align=right dir=rtl>" &_
    " hello " & rsGetPass("customer_nickname") & "<BR><BR>" &_
    " at your request,the password are sent<BR><BR>" &_
    " <B>username:</B> " & rsGetPass("customer_username") & "<BR>" &_
    " <B>password:</B> " & rsGetPass("customer_password") & "<BR><BR>" &_
    " " & SITE_TEAM_NAME & "<BR><BR>" &_
    " <a href=""" & SITE_URL & """>" & SITE_NAME & "</a><BR>" &_
    " </td>" &_
    " </tr>" &_
    "</table>"

    body = "<html><head></head><body bgcolor=GhostWhite>" &_
    "<style>" &_
    "table,a,td{font-size:14px;font-color:white;font-family:arial};" & vbNewLine &_
    "fieldset{font-size:14px;}" & vbNewLine &_
    ".mailHead1{font-size:26;color:black;font-weight:bold} " & vbNewLine &_
    "</style>" & vbNewLine &_
    "<table cellpadding='0' cellspacing='1' bgcolor=gray align='center' width='600' height='100%'><tr><td bgcolor=whitesmoke>" & vbNewLine &_
    "<table cellpadding='0' cellspacing='0' align='center' width='600' height='100%'>" & vbNewLine &_
    " <tr>" & vbNewLine &_
    " <td height='64' align='center' class='mailHead1' bgcolor='white'><img align='absbottom' src='" & SITE_URL & "/img/popupTop.jpg'></td>" & vbNewLine &_
    " </tr>" & vbNewLine &_
    " <tr>" & vbNewLine &_
    " <td valign='top'>" & vbNewLine &_
    " <BR>" & vbNewLine &_
    " <table cellpadding='0' cellspacing='0' align='center' width='95%'>" & vbNewLine &_
    " <tr>" & vbNewLine &_
    " <td align=right dir=rtl>" & vbNewLine &_
    bodyText &_
    " </td>" & vbNewLine &_
    " </tr>" & vbNewLine &_
    " </table><BR><BR>" & vbNewLine &_
    " </td>" & vbNewLine &_
    " </tr>" & vbNewLine &_
    "</table>" & vbNewLine &_
    "</td></tr></table><BR><BR>"& vbNewLine &_
    "</body></html>"


    customer_name = rsGetPass("customer_fname") & " " & rsGetPass("customer_lname")

    call SendMail(MailwFromName,MailwFromAddress,customer_name,customer_email,"Your account details in " & SITE_NAME,body)
    else
    found = false
    end if
    rsGetPass.close
    Set rsGetPass = nothing
    call close_connection
    end if
    %>
    <table cellpadding="0" cellspacing="0" dir="rtl" width="95%" height="100%" align="center">
    <tr>
    <td class="headline1" height="30"><BR>Password reminder</td>
    </tr>
    <tr><td height="10px"></td></tr>
    <%if action <> "getPass" then%>
    <script language=JavaScript src="../blablabla.js" type=text/javascript></script>
    <script>
    function validate(inForm)
    {
    if(isEmpty(inForm.email.value))
    {
    alert("please submit a legal e mail");
    inForm.email.focus();
    return false;
    }
    else if(!validEmail(inForm.email.value))
    {
    alert("please submit a legal e mail");
    inForm.email.focus();
    return false;
    }
    return true;
    }
    </script>
    <form method="post" onsubmit="return validate(this)">
    <input type="hidden" name="action" value="getPass">
    <tr>
    <td align="right" height="50">
    To recieve the password
    please submit your e mail

    </td>
    </tr>
    <tr><td height="10px"></td></tr>
    <tr>
    <td align="right" height="50" dir="ltr">
    E mail<BR>
    <input type="text" class="inputBox" name="email" style="width:180px">
    <BR><BR>
    <input type="submit" value="submit" ></td>

    </td>
    </tr>

    </form>
    <%else
    if not found then%>
    <form method="get" action="forgotpass.asp">
    <tr>
    <td align="right" height="100">
    wrong e mail<BR><BR>
    <BR>

    <a href="forgotpass.asp">try again</a>.

    </td>
    </tr>
    <tr><td height="10px"></td></tr>
    </form>
    <%else%>

    <tr>
    <td align="right" valign="top">
    The data are sent to your e mail
    </td>
    </tr>
    <%
    end if
    end if
    %>
    <tr>
    <td height="60%" valign="bottom" align="center">
    </td>
    </tr>
    <tr>
    <td height="5"></td>
    </tr>
    </table>

    and this is the script of smtp (new):

    <%
    Dim ObjSendMail
    Set ObjSendMail = Server.CreateObject("Persits.MailSender")

    ObjSendMail.Host = "mail.somesite.com"
    ObjSendMail.From = "[email protected]"
    ObjSendMail.FromName = "someone"
    ObjSendMail.AddAddress "[email protected]"
    ObjSendMail.Subject = "your subject"
    ObjSendMail.Body = "your email body"

    'If Your email server requires SMTP Authentication uncomment and use the values below
    'ObjSendMail.Username = "SMTPUsername"
    'ObjSendMail.Password = "SMTPPassword"

    On Error Resume Next

    ObjSendMail.Send

    If Err <> 0 Then
    Response.Write "Error encountered: " & Err.Description
    End
    If

    Set ObjSendMail = nothing
    %>

    anybody? how to integrate the script in to the reminder? (the green one to gray one) :p
    thnks
     
  2. lumentec

    lumentec

    Joined:
    Mar 23, 2008
    Messages:
    103
    In case you were wondering... I don't work with whatever the code is you're using here, so I can't help you. :p
     
  3. staso

    staso Thread Starter

    Joined:
    Sep 27, 2008
    Messages:
    11
    thanks , somebody?
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/754078

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice