PDA

View Full Version : مشکل در ارسال نامه



faramarz_s
جمعه 09 آبان 1382, 16:47 عصر
Server Error in '/' Application.
--------------------------------------------------------------------------------

Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.




MailMessage Mailer = new MailMessage();Mailer.From = "info@merat.org"; Mailer.To = "faramarz_s@hotmail.com";Mailer.Subject = "Example Sending mail";...

Vahid_Nasiri
جمعه 09 آبان 1382, 21:39 عصر
باید به کاربر Machinename\ASPNET تعریف شده در سیستم مجوز فول برای استفاده از دایرکتوری برنامه را بدهید.
فقط بحث مجوزها اینجا وجود دارد و نه چیز دیگری.
احتمالا فولدر باید رید only باشد.... و یا فولدر های سطح بالاتر نیز اینچنین. یکبار تمام فایلها و فولدها را انتخاب کنید و سپس read only بودن آنها را که تیک خاکستری دارد بردارید .

faramarz_s
شنبه 10 آبان 1382, 19:10 عصر
نکته آنست که پیغام فوق را سرور وب ماتریکس می دهد نه سرور کلاینت در منزل!
http://doost.europe.webmatrixhosting.net/Default.aspx

Vahid_Nasiri
شنبه 10 آبان 1382, 19:13 عصر
در اینگونه موارد روی هاست به فوروم خود هاست مراجعه کنید. مثل اینکه این چند وقت با ایمیل مشکل پیدا کرده اند چون عده ای از آن برای فرستادن mass mail استفاده نموده و سرویس را محدود کرده اند به این دلیل...

faramarz_s
شنبه 10 آبان 1382, 19:19 عصر
خدا خیرتان بدهد من عین نمونه های اینترنتی را می نوشتم و جواب نمی داد فکر می کردم کار من مشکل داره!
بهر حال نمونه برنامه را هم قرار دادم:

private void Button1_Click(object sender, System.EventArgs e)
{
try
{
/*MailMessage Mailer = new MailMessage();
Mailer.From = TextBox1.Text;
Mailer.To = "faramarz_s@hotmail.com";
Mailer.Subject = TextBox2.Text;
Mailer.Body = TextBox3.Text;
Mailer.BodyFormat = System.Web.Mail.MailFormat.Html;

SmtpMail.Send(Mailer);*/
lblResult.Visible=true;
lblResult.Text="نامه شما با موفقیت ارسال گردید";
}
catch(Exception ex)
{
lblResult.Visible=true;
lblResult.Text = "خطا در ارسال نامه! " + ex.ToString();
}
}

private void Button2_Click(object sender, System.EventArgs e)
{
try
{


MailMessage mail = new MailMessage();

mail.From = "shahabedeen@hotmail.com";
mail.To = "faramarz_s@hotmail.com";
mail.Subject = "New ad-hoc request was posted";
mail.Body = "There is new ad-hoc request";
mail.BodyFormat = MailFormat.Text;

SmtpMail.SmtpServer = "localhost";

SmtpMail.Send(mail);
lblResult.Text="نامه شما با موفقیت ارسال گردید";
}
catch (Exception e1)
{
//lblResult.Enabled=true;
lblResult.Text= "خطا در ارسال نامه! " + e1.ToString();




}
}

faramarz_s
شنبه 10 آبان 1382, 19:22 عصر
http://shahabedeen.europe.webmatrixhosting.net/Default.aspx

Vahid_Nasiri
شنبه 10 آبان 1382, 19:23 عصر
کد شما مشکلی ندارد فقط هاست خیلی عصبانی است از دست کاربران خاطی!
تا جایی که در فوروم آن دیدم گفته اند اگر کسی در روز بیشتر از 6 ایمیل از سایت بزند حذفش می کنند! :skull:

faramarz_s
شنبه 10 آبان 1382, 19:36 عصر
http://europe.webmatrixhosting.net/text.aspx?tmpl=board_thread&m_no=3913&d_no=1