Dim Mail1 As System.Web.Mail.MailMessage
Mail1 = new System.Web.Mail.MailMessage()
Mail1.From = "[email protected]"
Mail1.To = "[email protected]"
Mail1.Subject = "Subject"
Mail1.Body = "Bodytest tes "
System.Web.Mail.SmtpMail.SmtpServer = "mail.mydomain.jodoshared.com"
try
System.Web.Mail.SmtpMail.Send(Mail1)
catch exc as exception
response.write(exc.Message)
end try
Now I get the error:
Could not access ‘CDO.Message’
[/QUOTE]
Sorry, I didn’t examine the code closely enough. I think you need a reference to the SmtpMail object. The following code is basically the same as what I am using on my sites:
Dim Mailer as System.Web.Mail.SmtpMail
Dim Mail1 As System.Web.Mail.MailMessage
Mail1 = new System.Web.Mail.MailMessage()
Mail1.From = "[email protected]"
Mail1.To = "[email protected]"
Mail1.Subject = "Subject"
Mail1.Body = "Body"
Try
Mailer.SmtpServer = "mail.mydomain.com"
Mailer.Send(Mail1)
Catch Exc As Exception
Response.Write(Exc.Message)
End Try
Sorry, I had some custom Exception Handlers, the real error seems to be this:
The server rejected one or more recipient addresses. The server response was: 553 sorry, that domain isn’t allowed to be relayed thru this MTA (#5.7.1)
This seems to be a problem with POP before SMTP? Do I have to change some email settings?
[QUOTE=Robse]
Sorry, I had some custom Exception Handlers, the real error seems to be this:
The server rejected one or more recipient addresses. The server response was: 553 sorry, that domain isn’t allowed to be relayed thru this MTA (#5.7.1)
This seems to be a problem with POP before SMTP? Do I have to change some email settings?
[/QUOTE]
I can only suggest that either the To or From must be a valid mailbox at yourdomain.com. Also, the server should be mail.yourdomain.com and the domian specified in the To or From must be the same as the servername.
Hey thanks for your repies, I didn’t expect to here from anyone tonight. I feel like i’m going crazy because it just started working and I didn’t change anything. I wonder if there was just a few mins when the server wasn’t working right… Oh well it works now so thats what i care about.
If you are sending a significant volume of email from our mail server, you’d need to fill out the mass-mailing form to ensure mass-mailing restrictions on your domain are removed
50 emails/day per mailbox is the current restriction if you use mail.yourdomain.com as SMTP server. You need to fill out the form to have this removed.
If you use localhost as SMTP server, no restriction.
Your SMTP server doesn’t allow to send outbound email to any other email address since you haven’t given the user id and password. Try to send to some valid email id on the same domain and it works just fine. For e.g. from address is “[email protected]” and to address is “[email protected]”. I just tried your code and worked for me.