电子邮件发送问题asp.net [英] email sending problem asp.net
问题描述
大家好,
我面临这个问题,从我的网站发送电子邮件到链接邮件帐户。
用户不在本地;请尝试不同的路径。服务器响应为:发件人地址对您的登录无效。
检查您的电子邮件程序设置。
Hi Guys,
I am facing this issue to send email from my website to linked mail account.
User not local; please try a different path. The server response was: Sender address is not valid for your login.
Check your email program settings.
Exception Details: System.Net.Mail.SmtpException: User not local; please try a different path. The server response was: Sender address is not valid for your login. Check your email program settings.
Line 21: 'send the message
Line 22: Dim smtp As New SmtpClient("mail.dadaremoval.com.au")
Line 23: smtp.Send(mail)
Line 24:
Line 25: 'Response.Redirect("thanks.htm", False)
ITS SHOWING THE ERROR ON LINE 23
我正在使用此代码发送电子邮件。
I am using this code to send email.
'set the addresses
mail.From = New MailAddress(Me.email.Text)
mail.To.Add()
'set the content
mail.Subject = "Online booking"
mail.Body = "Hi"
' mail.Body = "Hi, you got Job. Here are the details of booking " & vbCrLf & " " & vbCrLf & "Passenger name: " + Me.nameTextBox.Text + "" & vbCrLf & "" & vbCrLf & " Phone number: " + Me.phoneTextBox.Text + "" & vbCrLf & " " & vbCrLf & "Booking date: " + Me.booking.Text & vbCrLf & "Email: " + Me.email.Text + "" & vbCrLf & "" & vbCrLf & "" & vbCrLf & "Passenger Pick-up details" & vbCrLf & " Unit/Flat numder: " + Me.unitTextBox.Text + "" & vbCrLf & " " & vbCrLf & "Street number: " + Me.stnumberTextBox.Text + "" & vbCrLf & "" & vbCrLf & " Street Name: " + Me.stnameTextBox.Text + "" & vbCrLf & " " & vbCrLf & "Suburb: " + Me.sbdrop.SelectedValue + "" & vbCrLf & "" & vbCrLf & " Building type: " + Me.radio1.SelectedValue + "" & vbCrLf & " " & vbCrLf & "" & vbCrLf & "Passenger destination" & vbCrLf & " Unit/Flat numder: " + Me.unit1.Text + "" & vbCrLf & " " & vbCrLf & "Street number: " + Me.stnumber1.Text + "" & vbCrLf & "" & vbCrLf & " Street Name: " + Me.stname1.Text + "" & vbCrLf & " " & vbCrLf & "Suburb: " + Me.sbdrop1.SelectedValue + "" & vbCrLf & "" & vbCrLf & "Building type:" + Me.radio1.SelectedValue + "" & vbCrLf & "" & vbCrLf & "" + "Have a Nice Day ! "
'send the message
Dim smtp As New SmtpClient("50.22.16.2")
smtp.Send(mail)
请帮我解决这个问题。
谢谢
Please help me to solve this issue.
Thanks
推荐答案
mail.From = New MailAddress(Me.email.Text)
mail.To.Add()
mail.From = New MailAddress(Me.email.Text)
mail.To.Add()
问题在于来自,这里你使用的是从地址添加的文本框,所以它无效在您的smtp域中,请指定用于登录smtp客户端的用户名和密码
The Problem is with "from", here you are using text box to add from address so it is not valid in your smtp domain please specify user name and password for login for smtp client
查看此 HTTP://www.astahost.c om / info / tilffm-sending-mail-net.html [ ^ ]
这是在C#中检查类似于VB
This is in C# check similar for VB
System.Net.Mail.MailMessage Message = new System.Net.Mail.MailMessage();
Message.From = new System.Net.Mail.MailAddress(FromId));
我认为这应该可以解决你的问题
或者检查smtp服务器设置
I think this should solve your Problem
Or else check the smtp server settings
这篇关于电子邮件发送问题asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!