小编Ign*_*s01的帖子

C#-发送电子邮件-STOREDRV.Submission.Exception:OutboundSpamException

我正在编写一个小型实用程序,以帮助其每晚处理一些MySQL任务,并在失败时通过电子邮件将其发送给我的个人电子邮件(这是一个个人项目,因此没有公司的smtp服务器或其他任何东西,都通过公众视野帐户发送电子邮件)。

我测试了大约5次,每次发送都成功,但是现在任何发送电子邮件的尝试都得到了这个异常:

Error sending test email: Transaction failed. The server response was: 5.2.0 STOREDRV.Submission.Exception:OutboundSpamException; Failed to process message due to a permanent exception with message WASCL UserAction verdict is not None. Actual verdict is Suspend, ShowTierUpgrade. OutboundSpamException: WASCL UserAction verdict is not None. Actual verdict is Suspend, ShowTierUpgrade.[Hostname=BY2PR0101MB1461.prod.exchangelabs.com]

有点麻烦-没想到Outlook在第六次尝试中就不会将其视为垃圾邮件-我可以在Outlook中做些什么来纠正此问题吗?

我正在使用在Outlook中创建的服务帐户将这些电子邮件发送到我的个人收件箱。

有问题的实际代码:

class JobMailer
{
    private string email_to;
    private string email_from;
    private string password;
    private string email_smtp;
    private bool use_ssl;
    private int port;

    public void Send(string subject, string body)
    {
        MailMessage …
Run Code Online (Sandbox Code Playgroud)

c# outlook smtp

7
推荐指数
1
解决办法
5592
查看次数

Angular 7 - NavigationEnd 和 OnDestroy 计时问题

我们刚刚将我们的项目从 Angular 6 升级到 Angular 7,并注意到以下问题,即在组件被销毁之前发出 NavigationEnd 事件。在升级到 Angular 7 之前,我们看到 NavigationEnd 事件在组件被销毁后发出。

WidgetContainerComponent 的每个实例都订阅了 ngOnInit 中可观察的配置,而 ngOnDestroy 将取消订阅它。

  constructor(@SkipSelf() private dataProviderDirective: DataProviderDirective) {
    super();
  }

  ngOnInit(): void {
    console.log("WidgetContainer.ngOnInit called");
    const _self = this;
    this.dataProviderDirective.getConfigurationPublisher().subscribe(widgetConfigurations => {
      _self.processConfiguration(widgetConfigurations, this.alias);
      this.subscribe(this.wsDataTopic + this.configuration.id, (message: Message) => this.onDataTopic(message));
      this.subscribe(this.wsStaleTopic + this.configuration.id, (message: Message) => this.onStaleTopic(message));
    });
  }

  ngOnDestroy(): void {
    console.log("WidgetContainer.ngOnDestroy() called");
  }
Run Code Online (Sandbox Code Playgroud)

包含这些组件的另一个组件 (DashboardContainerComponent) 具有以下内容:

  navigationSubscription;

  constructor(@Host() private dashboardComponent: DashboardComponent, private router:Router) {
    super();
    this.navigationSubscription = this.router.events.subscribe((e: any) => { …
Run Code Online (Sandbox Code Playgroud)

angular angular-router

5
推荐指数
0
解决办法
1118
查看次数

C++相同的字符串比较检查失败

我已经被这个问题难住了好几天了。我正在对我的一门课程进行单元测试,以确保一切正确。

然而,在比较对象的名称时,我遇到了一个非常奇怪的“错误”。当我调用构造函数时设置名称。根据我传入的注释正确设置了名称。但是在这种情况下 BOOST_CHECK 失败

为了显示这是多么奇怪,以下是调试器中两个字符串的值:

Fdim.name() // "F Diminished"
BOOST_CHECK(Fdim.name() == "F Diminished");  // this fails
Run Code Online (Sandbox Code Playgroud)

以下是从调试器获取的两个字符串的规格:

Fdim.name() 
// size - 12, capacity - 15, 
// chars: [70, 32, 68, 105, 109, 105, 110, 105, 115, 104, 101, 100]

"F Diminished" stored inside a variable (to see specs of string)
// size - 12, capacity - 15,
// chars: [70, 32, 68, 105, 109, 105, 110, 105, 115, 104, 101, 100]
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,字符串是相同的,但 == 和 .compare 都失败了。

还有更奇怪的事情:

std::string n = …
Run Code Online (Sandbox Code Playgroud)

c++ string compare visual-studio-2012

3
推荐指数
1
解决办法
5647
查看次数

c++/cli 仅向托管类公开内部成员

假设我有一个 c++ 非托管类,看起来像这样

#include "note.h"
class chord
{
private:
    note* _root;   // or, as in my real class: std::shared_ptr<note> _root;
    // _third, _fifth, _seventh, etc
public:
    someClass(const note n1, const note n2, const note n3);  // constructor takes some of these notes to make a chord

    std::shared_ptr<note> root() const;   // returns ptr to root of the chord
    std::string name() const;  // returns the name of this chord

}
Run Code Online (Sandbox Code Playgroud)

现在,我知道我需要将这两个类都包装到 cli 中的托管类中。但问题是,如何将指向本机类的私有指针传递给构造函数?

就目前而言, Note* _src 在 noteWrapper 中是私有的。但是原生 Chord() 需要原生 Note …

.net c# c++ wpf c++-cli

2
推荐指数
1
解决办法
4201
查看次数

删除模板分配的数组,可能已分配索引

我正在重新编写一个旧的循环缓冲类,我写的更强大.我在堆上分配一个类型为T的缓冲区(因此该类是模板化的).但是,我遇到了释放资源的问题,这可能是T是指向动态分配空间的指针.

这是一个默认值参数的ctor

template <typename T, unsigned int SIZE>
CircularBuffer(const T default_val) {
    _buffer = new T[SIZE];
    // assign each block default value, etc
}

// dtor
~CircularBuffer()
{
    delete [] _buffer;
}
Run Code Online (Sandbox Code Playgroud)

但是,例如有人决定这样做:

CircularBuffer<int*, 4> cb(new int); // buffer of 4, holding int*, with default value of new int

// later ~CircularBuffer call is made
// user allocated memory is not freed
Run Code Online (Sandbox Code Playgroud)

我怎样才能(或让用户)释放这个记忆?我从用户角度尝试手动:

delete cb.at(0);  // .at returns T& (so it would effectively return the pointer)
// above is access …
Run Code Online (Sandbox Code Playgroud)

c++ heap memory-management new-operator c++11

2
推荐指数
2
解决办法
1824
查看次数

Lua - xpcall和Try一样慢...用其他语言捕获?

我似乎无法在网上找到任何关于此的信息,但是使用xpcall vs直接在lua中调用函数有什么性能影响:

a)什么时候没有错误?

b)发生错误时?

是否类似于try ...来自其他语言的处理异常会导致性能问题?

lua

2
推荐指数
1
解决办法
314
查看次数