2012-05-17 124 views
0

我在nopcommerce電子商務網站上工作。我想發送郵件,當用戶已經註冊之前,並試圖用相同的電子郵件ID再次註冊。郵件包含正文內容爲「此用戶的用戶名是某個用戶名」。當我編寫代碼並執行它時,但它在本地運行良好。但是當我在服務器上運行它(在IIS服務器中創建新網站後)時,郵件未發送。另一件事是我創建的頁面,它顯示爲「郵件是成功發送「顯示在本地。但它不會在服務器上顯示,即使url是相同的。任何人都可以告訴我解決方案。郵件發送本地主機,但不是在服務器

+0

在上傳文件到你的服務器,你改變了SMTP主機? Mail服務守護程序是否已啓動並在您的服務器上運行? – verisimilitude

+0

請參閱http://www.emailarchitect.net/webapp/smtpcom/developers/smtpservice.asp,http://forums.iis.net/t/1157046.aspx –

+0

但所有其他電子郵件在服務器上成功發送,除此之外電子郵件 – Sharathsshetty

回答

1

此解決方案需要sendmail.exe(一個命令行界面(CLI)可執行文件,它接受來自PHP的電子郵件,連接到SMTP服務器併發送電子郵件)。您將不需要通過命令來使用它,不要麻煩了:-)下載sendmail.zip,並按照下列步驟操作:

Create a folder named 「sendmail」 in 「C:\wamp\」. 
Extract these 4 files in 「sendmail」 folder: 「sendmail.exe」, 「libeay32.dll」, 「ssleay32.dll」 and 「sendmail.ini」. 
Open the 「sendmail.ini」 file and configure it as following 
    smtp_server=smtp.gmail.com 
    smtp_port=465 
    smtp_ssl=ssl 
    default_domain=localhost 
    error_logfile=error.log 
    debug_logfile=debug.log 
    auth_username=[your_gmail_account_username]@gmail.com 
    auth_password=[your_gmail_account_password] 
    pop3_server= 
    pop3_username= 
    pop3_password= 
    force_sender= 
    force_recipient= 
    hostname=localhost 

You do not need to specify any value for these properties: pop3_server, pop3_username, pop3_password, force_sender, force_recipient. The error_logfile and debug_logfile settings should be kept blank if you have already sent successful email(s) otherwise size of this file will keep increasing. Enable these log file settings if you don’t get able to send email using sendmail. 
+0

請參閱此處的詳細說明:http://blog.techwheels.net/send-email-from-localhost-wamp-server-using-sendmail/ – Krishna

相關問題