You are here

GoDaddy上配置Drupal发邮件遇到问题

g089h515r806 的头像
Submitted by g089h515r806 on 星期日, 2010-05-30 13:02

GoDaddy是一个很有名的主机提供商,好像国内也有很多人用,我的一个学员曾遇到过这样的问题,那就是drupal中SMTP发不了邮件,使用的是gmail的帐号。

注意,好像下面的文字中学员写错了,godday应该是godaddy

由于godaddy自己好像不直接支持邮件发送,在本地配制好的gmail的邮件发送,放到godaddy的站点上,就失效了。今天又有人问同样的问题,

学员1: 老葛,请教下,我使用smtp模块发送邮件,一直提示“SMTP -> ERROR: Failed to connect to serve”,我的帐户密码肯定填写对了
  这个smtp邮件和站点信息里的邮件帐户一样
16:27 以前按照这个方法都可以的
 我: gmail
16:28 么?
 学员1: 我用gmail和163的都试过了
  gmail端口改为465,ssl
 我: 163的不行
  gmail的可以
  163的付费用户好像可以
16:29 学员1: 不知道是我空间问题,我用的godday空间
  gmail的设置应该也没有问题,很奇怪
16:31 我: godday不可以的
16:32 空间的问题
  以前一个学员问过这样的问题
  不过可以使用godday提供的smtp服务

我已经登陆不了学员的网站的,我大概记得是这样解决的,我让朋友写信给godday,回复我还保留着,

Support Staff Response
Dear Sir/Madam,

We were able to verify the account with the provided information. In order to be able to send email through our hosting accounts that we offer you must use the following relay server in your code:

relay-hosting.secureserver.net

You do not need to provide a user name and password for this relay server as it does not require authentication.

Two non-CGI form mailers are included in Linux shared hosting account default files: webformmailer.php and gdform.php. They reside in the root directory of your hosting account. Incorporating either of these scripts into your website creates a form to capture user information and email it to a specified address.

For more information about designating the destination email address, see Specifying an Email Address for the PHP Form-Mailer.

 

Note: webformmailer.php is for use with accounts running Hosting Configuration 2.0 and above, only. For information, see What functionality does Hosting Configuration 2.0 provide? and How do I upgrade my hosting account to run Hosting Configuration 2.0?

 

 

webformmailer.php

 

 

To Use webformmailer.php

 

Create a Web form, assigning unique names to your form fields.

In the form tag, assign /webformmailer.php to the action attribute and set the form method to post:

<form action="/webformmailer.php" method="post">

 

In addition to the form fields you create, there are three hidden elements you can use.

form_format determines in what format the information is delivered. Its values are 'text', 'csv', 'html', 'xml', and 'default' (same as 'text').

form_order dictates in what order the fields are reported. Its values are 'default' (the same order as they appear on in the form), 'alpha' (alphabetized by field name) or a comma-separated, case-sensitive list of all or some field names.

form_delivery determines the frequency and packaging of delivery. All form submissions are sent via an attachment. You can specify the form_delivery variables as one of the following: 'digest', 'hourly_digest', and 'daily_digest'.

For example:

<form action="/webformmailer.php" method="post">
<input type="hidden" name="subject" value="Submission" />
<input type="hidden" name="redirect" value="thankyou.html" />
First Name: <input type="text" name="FirstName" />
Last Name :<input type="text" name="LastName" />
Email: <input type="text" name="email" />
Comments: <textarea name="comments" cols="40" rows="10">
Type comments here.</textarea>
<input type="submit" name="submit" value="submit"/>
<input type="hidden" name="form_order" value="alpha"/>
<input type="hidden" name="form_delivery" value="hourly_digest"/>
<input type="hidden" name="form_format" value="html"/>
</form>

 

 

 

 

 

 

gdform.php

 

 

To Use gdform.php

 

Create your Web form as normal and assign unique names to your form items.

NOTE: Keep in mind that our form-mailer script will sort the names of your form items alphabetically when it composes the email message. This is the order of precedence: uppercase letters, lowercase letters, numbers.

For the form action line, enter /gdform.php. For example:

<form action="/gdform.php" method="post">

 

Set the form method to "post."

In addition to the fields you create in your form, there are three special fields that you can use: subject, redirect, and email.

Subject. Controls the subject line in the form email.

Redirect. Controls the page that your visitors will see after they submit the form.

Email. Controls the return address for the form email.

For example:

<form action="/gdform.php" method="post">
<input type="hidden" name="subject" value="Form Submission" />
<input type="hidden" name="redirect" value="thankyou.html" />
<p>First Name:<input type="text" name="FirstName" /></p>
<p>Last Name:<input type="text" name="LastName" /></p>
<p>E-Mail:<input type="text" name="email" /></p>
<p>Comments:<textarea name="comments" cols="40" rows="10">
Type comments here.</textarea></p>
<input type="submit" name="submit" value="submit"/>
</form>

 

Save and upload your file to your hosting account.

 

 

 

 

For information on reinstalling your default scripts, see How Do I Reinstall the Default Scripts Directory?

我记得,我把relay-hosting.secureserver.net直接设置为了邮件服务器,连用户名密码都没有设置,就可以发送邮件了。印象中就是这样,直接使用主机提供商的邮件服务器,没有填写用户名,密码,就可以了。具体我也忘了。这里的仅供遇到同样的问题的朋友参考,如果找到正确的解决办法可以在本文下面补充。

 

 

 

For information on reinstalling your default scripts, see How Do I Reinstall the Default Scripts Directory?

 

Drupal版本: