AhmerAli1813 / Online_Help_Desk

This project is aimed at developing an Online Help Desk for the facilities in the campus. This is an Internet based application that can be accessed throughout the campus.
5 stars 2 forks source link

SmtpException #4

Closed GOMTHAA closed 6 days ago

GOMTHAA commented 2 weeks ago

SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 Client not authenticated to send mail. Error: 535 5.7.139 Authentication unsuccessful, basic authentication is disabled. [MA0PR01CA0068.INDPRD01.PROD.OUTLOOK.COM 2024-10-15T16:18:27.237Z 08DCECCED383AD48]

When i try to login

AhmerAli1813 commented 2 weeks ago

Create new email Account on outlook and username passwords Path :Services/utilityClasses/EmailSender.cs

client.Credentials = new NetworkCredential("YourEmailAddress@outlook.com", "YourPasswoard");
GOMTHAA commented 1 week ago

image_2024-10-22_180702010 U want me to change this into the code u gave? And create a new outlook email?

GOMTHAA commented 1 week ago

I did sir its still showing the same error image image image

AhmerAli1813 commented 1 week ago

Yes, it works!

On Tue, Oct 22, 2024 at 5:37 PM GOMTHAA @.***> wrote:

image_2024-10-22_180702010.png (view on web) https://github.com/user-attachments/assets/f375beee-3543-46e4-bb2e-62772da1f344 U want me to change this into the code u gave? And create a new outlook email?

— Reply to this email directly, view it on GitHub https://github.com/AhmerAli1813/Online_Help_Desk/issues/4#issuecomment-2429169460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXS3RMELVJNPDYIQ435OSQTZ4ZBJPAVCNFSM6AAAAABQBDJSAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRZGE3DSNBWGA . You are receiving this because you commented.Message ID: @.***>

GOMTHAA commented 1 week ago

What to do sir?

GOMTHAA commented 1 week ago

Sir??

AhmerAli1813 commented 1 week ago

Email Sending Issue

Issue: The emailService class is unable to send emails to users, such as @.***, because it lacks the proper authorization. The credentials for sending emails are not defined within the emailService.

Current Code Snippet:

csharp

Copy code

client.Credentials = new @.***", "YourPassword");

Steps to Resolve

Define Credentials: Ensure that the credentials for the sender email are defined correctly in your emailService. Replace " @.***" and "YourPassword" with the actual sender's email and password.

Authorization: Make sure the email account used has the necessary permissions and is allowed to send emails programmatically.

Configuration: If you are using an email service provider (like Outlook), check if there are any specific settings or API configurations required for sending emails.

On Tue, Oct 22, 2024, 5:45 PM GOMTHAA @.***> wrote:

What to do sir?

— Reply to this email directly, view it on GitHub https://github.com/AhmerAli1813/Online_Help_Desk/issues/4#issuecomment-2429186272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXS3RMFEULFT56QTOU4BHCDZ4ZCGJAVCNFSM6AAAAABQBDJSAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRZGE4DMMRXGI . You are receiving this because you commented.Message ID: @.***>