VB中的邮件表单脚本 [英] Mail form script in VB

查看:78
本文介绍了VB中的邮件表单脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,当您从同一域中设置电子邮件时,我有一个很好的表格.

我的问题是我希望脚本将电子邮件发送到非同一域的帐户. (即:当我将电子邮件更改为you@yourdomain.com时,me @ mydomain.com.au不会发送邮件)

在下面,您将找到我的完整代码,如果有谁可以帮助我,将不胜感激:

Hi all, I''ve got a form which work well when an email is set from the same domain.

My problem is that I want the script to send the email to an account not from the same domain. (ie:me@mydomain.com.au works when I change the email to you@yourdomain.com it does not send the mail)

Below you will find my full code, If any one can help me, it would be appreciated:

<%
  DIM StrEmail, StrName, StrNumber, StrSubject, StrMessage, StrMsgHeader

   StrEmail = request.form("email")
   StrName = request.form("name")
   StrNumber = request.form("number")
   StrSubject = request.form("subject")
   StrMessage = request.form("message")

  Set Mail = Server.CreateObject("Persits.MailSender")
    Mail.Host = "mail.mydomain.com.au";
    Mail.From = "me@mydomain.com.au"
    Mail.AddAddress "you@yourdomain.com.au"
 


        Mail.Subject = "Enquiry Request Form"

 
     Mail.Body = strMsgHeader & "Email: " & StrEmail & vbCrLf & vbCrLf & _
     "Full Name : " & vbCrLf & StrName & vbCrLf & vbCrLf & _
     "Phone Number : "; & vbCrLf & StrNumber & vbCrLf & vbCrLf & _
     "Subject : " & vbCrLf & StrSubject & vbCrLf & vbCrLf & vbCrLf & _

     "Message: " & vbCrLf & StrMessage

   
     On Error Resume Next
     Mail.Send
     Set Mail = Nothing

    IF Err <> 0 THEN
     Response.Write "There has been an error and your message could not be sent through email." & Err.Description
    END IF

    %>

推荐答案

与此可能有多种关联. > 1)确保使用正确的域来发送电子邮件.
2)检查域正在使用的smtp端口(端口25可以是其他端口)
3)用于发送电子邮件的端口未被防火墙阻止.

希望有帮助.
There can be various scenarios associated with that.
1) Make sure that you are using correct domain for the email you are using to send.
2) Check what is the smtp port that domain is using (it can be other that port 25)
3) The port used for send email is not blocked by Firewall.

Hope that helps.


< u></u>感谢Amit,
第1点和第2点都可以,域正确,端口也可以,关于防火墙的第3点是什么意思.

如果防火墙有问题,我该如何解决.

抱歉,我没有提早回应...
<u></u>Thanks Amit,
The 1st 2 points are fine, domain is correct and the port is fine, what do you mean in the 3rd point regarding the firewall.

If it is an issue with the firewall how do i get around it.

Sorry I didn''t respond earlier...


这篇关于VB中的邮件表单脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆